_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
angular/CHANGELOG.md_330644_336490
Description | | -- | -- | -- | | [b380fdd59e](https://github.com/angular/angular/commit/b380fdd59e368e89908ea915f150cdc9f5a87a7f) | feat | add a density cap for image srcsets ([#47082](https://github.com/angular/angular/pull/47082)) | | [7ce497e5bc](https://github.com/angular/angular/commit/7ce497e5bc6502bed8099d2592888f3164cdcf1f) | feat | add built-in Imgix loader ([#47082](https://github.com/angular/angular/pull/47082)) | | [bff870db61](https://github.com/angular/angular/commit/bff870db6146850248597889550f676d81a85c90) | feat | add cloudflare loader ([#47082](https://github.com/angular/angular/pull/47082)) | | [86e77a5d55](https://github.com/angular/angular/commit/86e77a5d559eddb285e74cc34c0db73de5645022) | feat | add Image directive skeleton ([#45627](https://github.com/angular/angular/pull/45627)) ([#47082](https://github.com/angular/angular/pull/47082)) | | [0566205a02](https://github.com/angular/angular/commit/0566205a02c5dc87a01a0aa40cb5cdf147c81f11) | feat | Add image lazy loading and fetchpriority ([#47082](https://github.com/angular/angular/pull/47082)) | | [4e952ba216](https://github.com/angular/angular/commit/4e952ba216297eb60fb3bae797b73f5b72c7660b) | feat | add loaders for cloudinary & imagekit ([#47082](https://github.com/angular/angular/pull/47082)) | | [e854a8cdde](https://github.com/angular/angular/commit/e854a8cdde0f2fd00e67c0a841c8f6f0abcea18b) | feat | add loading attr to NgOptimizedImage ([#47082](https://github.com/angular/angular/pull/47082)) | | [8d3701cb4c](https://github.com/angular/angular/commit/8d3701cb4c167fb8b2153359a71e4f222d3d5657) | feat | add warnings re: image distortion ([#47082](https://github.com/angular/angular/pull/47082)) | | [d5f7da2120](https://github.com/angular/angular/commit/d5f7da21207f7808dffb3932fa61d22614e6bd57) | feat | define public API surface for NgOptimizedImage directive ([#47082](https://github.com/angular/angular/pull/47082)) | | [d3c3426aa4](https://github.com/angular/angular/commit/d3c3426aa41bd4092da3a9dd6951cab63f217db4) | feat | detect LCP images in `NgOptimizedImage` and assert if `priority` is set ([#47082](https://github.com/angular/angular/pull/47082)) | | [451b85ca17](https://github.com/angular/angular/commit/451b85ca176e0aeae6358016e2695ea133d9ec56) | feat | explain why width/height is required ([#47082](https://github.com/angular/angular/pull/47082)) | | [586274fe65](https://github.com/angular/angular/commit/586274fe65c5184b633e0e5ac12ca91979f138b2) | feat | provide an ability to exclude origins from preconnect checks in NgOptimizedImage ([#47082](https://github.com/angular/angular/pull/47082)) | | [57f3386e5b](https://github.com/angular/angular/commit/57f3386e5b5a3d6edc9e6d8c60b442b16e5c4a20) | feat | support custom srcset attributes in NgOptimizedImage ([#47082](https://github.com/angular/angular/pull/47082)) | | [7baf9a46cd](https://github.com/angular/angular/commit/7baf9a46cde2eb2d923c6b2d5e6afb51de9e3f2b) | feat | verify that priority images have preconnect links ([#47082](https://github.com/angular/angular/pull/47082)) | | [f81765b333](https://github.com/angular/angular/commit/f81765b333881bd156383d81be62c06ff00380c1) | feat | warn if rendered size is much smaller than intrinsic ([#47082](https://github.com/angular/angular/pull/47082)) | | [e2ab99b95e](https://github.com/angular/angular/commit/e2ab99b95efd893c49d15c02cccd72ef82ea1cae) | fix | allow null/undefined to be passed to ngClass input ([#39280](https://github.com/angular/angular/pull/39280)) ([#46906](https://github.com/angular/angular/pull/46906)) | | [bedf537951](https://github.com/angular/angular/commit/bedf537951e64c55dde9b38936e451daa4a4bde9) | fix | allow null/undefined to be passed to ngStyle input ([#47069](https://github.com/angular/angular/pull/47069)) | | [f9511bf6e8](https://github.com/angular/angular/commit/f9511bf6e8322f292421bcc0fa7851535aeaac85) | fix | avoid interacting with a destroyed injector ([#47243](https://github.com/angular/angular/pull/47243)) | | [dc29e21b14](https://github.com/angular/angular/commit/dc29e21b141574247b5f9f859c019b4ad4be9742) | fix | consider density descriptors with multiple digits as valid ([#47230](https://github.com/angular/angular/pull/47230)) | | [801daf82d1](https://github.com/angular/angular/commit/801daf82d119a39f21d26812b28c8551c58d841b) | fix | detect `data:` and `blob:` inputs in `NgOptimizedImage` directive ([#47082](https://github.com/angular/angular/pull/47082)) | | [fff8056e7f](https://github.com/angular/angular/commit/fff8056e7f5fffd6d54315ca3897505ad5da725f) | fix | fix formatting on oversized image error ([#47188](https://github.com/angular/angular/pull/47188)) ([#47232](https://github.com/angular/angular/pull/47232)) | | [1ca2ce19ab](https://github.com/angular/angular/commit/1ca2ce19ab871c76bee3ad67ee9c610284ca9281) | fix | remove default for image width ([#47082](https://github.com/angular/angular/pull/47082)) | | [c5db867ddc](https://github.com/angular/angular/commit/c5db867ddcac10720a23487461994bbf682898e9) | fix | remove duplicate deepForEach ([#47189](https://github.com/angular/angular/pull/47189)) | | [1cf43deb18](https://github.com/angular/angular/commit/1cf43deb1899440c0bd468f8bf31390d4f23d678) | fix | sanitize `rawSrc` and `rawSrcset` values in NgOptimizedImage directive ([#47082](https://github.com/angular/angular/pull/47082)) | | [d71dfe931f](https://github.com/angular/angular/commit/d71dfe931f71bff71e4e7af96aebd59f31cd4079) | fix | set bound width and height onto host element ([#47082](https://github.com/angular/angular/pull/47082)) | | [32caa8b669](https://github.com/angular/angular/commit/32caa8b66908097522658360e5907c5004c13eeb) | fix | support density descriptors with 2+ decimals ([#47197](https://github.com/angular/angular/pull/47197)) ([#47232](https://github.com/angular/angular/pull/47232)) | | [ae4405f0bf](https://githu
{ "end_byte": 336490, "start_byte": 330644, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_336491_342352
.com/angular/angular/commit/ae4405f0bf1c94fe86d9e9a62360834e80cef8e7) | fix | throw if srcset is used with rawSrc ([#47082](https://github.com/angular/angular/pull/47082)) | | [0c8eb8bc82](https://github.com/angular/angular/commit/0c8eb8bc82c26596092d4774fcdac255aecdec90) | perf | monitor LCP only for images without `priority` attribute ([#47082](https://github.com/angular/angular/pull/47082)) | ### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [ea89677c12](https://github.com/angular/angular/commit/ea89677c125c16654e3e521998b575687c2bd20c) | feat | support more recent version of `tsickle` ([#47018](https://github.com/angular/angular/pull/47018)) | ### core | Commit | Type | Description | | -- | -- | -- | | [d1e83e1b30](https://github.com/angular/angular/commit/d1e83e1b30f2cea9f2ed16bff2d3b969335072ab) | feat | add `createComponent` function ([#46685](https://github.com/angular/angular/pull/46685)) | | [10becab70e](https://github.com/angular/angular/commit/10becab70e0f2afee29da7b3358eedcc22f655a2) | feat | add `reflectComponentType` function ([#46685](https://github.com/angular/angular/pull/46685)) | | [4b377d3a6d](https://github.com/angular/angular/commit/4b377d3a6d069da23ec577f8deca761b01d4e2f5) | feat | introduce createApplication API ([#46475](https://github.com/angular/angular/pull/46475)) | | [31429eaccc](https://github.com/angular/angular/commit/31429eaccc973672efb4ed98a628cf9842e24b02) | feat | support TypeScript 4.8 ([#47038](https://github.com/angular/angular/pull/47038)) | | [796840209c](https://github.com/angular/angular/commit/796840209cd38aacc5061a31701efe7eda1f6587) | fix | align TestBed interfaces and implementation ([#46635](https://github.com/angular/angular/pull/46635)) | ### forms | Commit | Type | Description | | -- | -- | -- | | [426af91a42](https://github.com/angular/angular/commit/426af91a42104d6ce227ab52c8c4db3e218f5e03) | feat | add `FormBuilder.record()` method ([#46485](https://github.com/angular/angular/pull/46485)) | | [b302797de4](https://github.com/angular/angular/commit/b302797de47409b988ad77e87f766a5f18374ded) | fix | Correctly infer `FormBuilder` types involving `[value, validators]` shorthand in more cases. ([#47034](https://github.com/angular/angular/pull/47034)) | ### language-service | Commit | Type | Description | | -- | -- | -- | | [598b72bd05](https://github.com/angular/angular/commit/598b72bd05ea33468c70ac35b8ea5286439f41d9) | feat | support fix the component missing member ([#46764](https://github.com/angular/angular/pull/46764)) | ### platform-browser | Commit | Type | Description | | -- | -- | -- | | [07606e3181](https://github.com/angular/angular/commit/07606e3181fc7aa9f9185eb771fc9c44f01fe344) | feat | add `isEmpty` method to the `TransferState` class ([#46915](https://github.com/angular/angular/pull/46915)) | ### platform-server | Commit | Type | Description | | -- | -- | -- | | [2b4d7f6733](https://github.com/angular/angular/commit/2b4d7f6733e10e45e3ca8a448307bbc2834fc4a1) | feat | support document reference in render functions ([#47032](https://github.com/angular/angular/pull/47032)) | ### router | Commit | Type | Description | | -- | -- | -- | | [0abb67af59](https://github.com/angular/angular/commit/0abb67af59a92a2b29082a259aa9f4ea3fbaab7d) | feat | allow guards and resolvers to be plain functions ([#46684](https://github.com/angular/angular/pull/46684)) | | [75df404467](https://github.com/angular/angular/commit/75df4044675c61d2b646437cfe64fe828a39b3a0) | feat | Create APIs for using Router without RouterModule ([#47010](https://github.com/angular/angular/pull/47010)) | | [10289f1f6e](https://github.com/angular/angular/commit/10289f1f6e3d5935304a38d4300d4dadfea66150) | feat | expose resolved route title ([#46826](https://github.com/angular/angular/pull/46826)) | | [8600732b09](https://github.com/angular/angular/commit/8600732b090a4c253eb89ffde6db3858e4a2021c) | feat | Expose the default matcher for `Routes` used by the `Router` ([#46913](https://github.com/angular/angular/pull/46913)) | | [422323cee0](https://github.com/angular/angular/commit/422323cee00192239d1ab279e6a7c3a808098169) | feat | improve typings for RouterLink boolean inputs ([#47101](https://github.com/angular/angular/pull/47101)) | | [26ea97688c](https://github.com/angular/angular/commit/26ea97688cba5850588d8da83abaf8b539577241) | feat | Make router directives standalone ([#46758](https://github.com/angular/angular/pull/46758)) | | [2a43beec15](https://github.com/angular/angular/commit/2a43beec159990b8c4bafc7f189e2bd85002dc7a) | fix | Fix route recognition behavior with some versions of rxjs ([#47098](https://github.com/angular/angular/pull/47098)) | ### service-worker | Commit | Type | Description | | -- | -- | -- | | [383090858c](https://github.com/angular/angular/commit/383090858caf04c27ee8b320cceca2da0ae54bb3) | feat | support `sendRequest` as a `notificationclick` action ([#46912](https://github.com/angular/angular/pull/46912)) | | [3f548610dd](https://github.com/angular/angular/commit/3f548610dd05f484cd33fa2cee4e3693ed731126) | fix | export NoNewVersionDetectedEvent ([#47044](https://github.com/angular/angular/pull/47044)) | | [482b6119c2](https://github.com/angular/angular/commit/482b6119c2f3fff5ec0623e101d308a49c416b42) | fix | update golden `index.md` ([#47044](https://github.com/angular/angular/pull/47044)) | ## Special Thanks Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bob Watson, Cédric Exbrayat, Dylan Hunn, Emmanuel Roux, FatalMerlin, George Kalpakas, Ilia Mirkin, Jan Kuehle, Jeremy Elbourn, Jessica Janiuk, JiaLiPassion, Kalbarczyk, Kara Erickson, Katie Hempenius, Kristiyan Kostadinov, Merlin, Paul Gschwendtner, Pawel Kozlowski, Tristan Sprößer, Victor Porof, angular-robot[bot], dario-piotrowicz, ivanwonder and vyom <!-- CHANGELOG SPLIT MARKER --> <a name="14.1.3"></a> # 14.1.3 (2022-08-17) ### compil
{ "end_byte": 342352, "start_byte": 336491, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_342352_345050
er | Commit | Type | Description | | -- | -- | -- | | [0583227708](https://github.com/angular/angular/commit/05832277089f9df9cde424d62033661620826592) | fix | infinite loop in parser assignment expression with invalid left-hand expression ([#47151](https://github.com/angular/angular/pull/47151)) | ## Special Thanks AlirezaEbrahimkhani, Alma Eyre, Andrew Scott, Bob Watson, George Kalpakas, Kalbarczyk, Kristiyan Kostadinov, Leosvel Pérez Espinosa, Roman Matusevich and Sonu Kapoor <!-- CHANGELOG SPLIT MARKER --> <a name="14.1.2"></a> # 14.1.2 (2022-08-10) ### core | Commit | Type | Description | | -- | -- | -- | | [5ff715c549](https://github.com/angular/angular/commit/5ff715c5497fcbcbb33eb93770470fff5a816cd5) | fix | check if transplanted views are attached to change detector ([#46974](https://github.com/angular/angular/pull/46974)) | ### router | Commit | Type | Description | | -- | -- | -- | | [439d77e852](https://github.com/angular/angular/commit/439d77e852c2e08d384c420a2c3a962a804c60f1) | fix | Fix route recognition behavior with some versions of rxjs ([#47098](https://github.com/angular/angular/pull/47098)) ([#47112](https://github.com/angular/angular/pull/47112)) | ## Special Thanks 4javier, Andrew Kushnir, Andrew Scott, AntonioCardenas, Bob Watson, Bruno Barbosa, Eduardo Speroni, Edward, George Kalpakas, Jan Melcher, Kristiyan Kostadinov, Mladen Jakovljević, Paul Gschwendtner, Pawel Kozlowski, Roman Matusevich, Vovch, ashide2729, ileil and onrails <!-- CHANGELOG SPLIT MARKER --> <a name="14.1.1"></a> # 14.1.1 (2022-08-03) ### core | Commit | Type | Description | | -- | -- | -- | | [3606917732](https://github.com/angular/angular/commit/3606917732e5ad887426c1cbccf6e375eff905d6) | fix | improve the missing control flow directive message ([#46903](https://github.com/angular/angular/pull/46903)) | ### router | Commit | Type | Description | | -- | -- | -- | | [79825d3f10](https://github.com/angular/angular/commit/79825d3f1078c9b91eeb5e4699718ccde6c458b5) | fix | Do not call preload method when not necessary ([#47007](https://github.com/angular/angular/pull/47007)) | | [05f3f7445a](https://github.com/angular/angular/commit/05f3f7445a0bbe3c7ffed3aec308ca8888e77d99) | fix | Use correct return type for provideRoutes function ([#46941](https://github.com/angular/angular/pull/46941)) | ## Special Thanks Alan Agius, Andrew Kushnir, Andrew Quinn, Andrew Scott, Aristeidis Bampakos, Asaf M, Bob Watson, Cédric Exbrayat, Durairaj Subramaniam, George Kalpakas, Ivaylo Kirov, J Rob Gant, Kristiyan Kostadinov, Marek Hám, Paul Gschwendtner, Roman Matusevich and Simona Cotin <!-- CHANGELOG SPLIT MARKER --> <a name="14.1.0"></a> # 14.1.0 (2022-07-20) ## Deprecation
{ "end_byte": 345050, "start_byte": 342352, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_345050_350196
s ### core - The `createNgModuleRef` is deprecated in favor of newly added `createNgModule` one. - The bit field signature of `inject()` has been deprecated, in favor of the new options object. Correspondingly, `InjectFlags` is deprecated as well. ### animations | Commit | Type | Description | | -- | -- | -- | | [55308f2df5](https://github.com/angular/angular/commit/55308f2df5b0f6e8e40e3c4085c463a5b83c5ed1) | feat | add `provideAnimations()` and `provideNoopAnimations()` functions ([#46793](https://github.com/angular/angular/pull/46793)) | ### common | Commit | Type | Description | | -- | -- | -- | | [4a2e7335b1](https://github.com/angular/angular/commit/4a2e7335b180190800cf2c5db8ed1c8841dbf473) | feat | make the `CommonModule` pipes standalone ([#46401](https://github.com/angular/angular/pull/46401)) | | [a7597dd080](https://github.com/angular/angular/commit/a7597dd08026a4071758323d54ccbfb382e0c780) | feat | make the CommonModule directives standalone ([#46469](https://github.com/angular/angular/pull/46469)) | ### compiler | Commit | Type | Description | | -- | -- | -- | | [33ce3883a5](https://github.com/angular/angular/commit/33ce3883a5d962adf5ee7feffd3426feefe0c0b5) | feat | Add extended diagnostic to warn when missing let on ngForOf ([#46683](https://github.com/angular/angular/pull/46683)) | | [6f11a58040](https://github.com/angular/angular/commit/6f11a580406877e440c43df31fae3d5f120cafed) | feat | Add extended diagnostic to warn when text attributes are intended to be bindings ([#46161](https://github.com/angular/angular/pull/46161)) | | [9e836c232f](https://github.com/angular/angular/commit/9e836c232ff66043bc101b905dae4c8bde18bc58) | feat | warn when style suffixes are used with attribute bindings ([#46651](https://github.com/angular/angular/pull/46651)) | ### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [93c65e7b14](https://github.com/angular/angular/commit/93c65e7b1468bb0c696dec1bc3362422a2ca5170) | feat | add extended diagnostic for non-nullable optional chains ([#46686](https://github.com/angular/angular/pull/46686)) | | [131d029da1](https://github.com/angular/angular/commit/131d029da16b7d486cdc200f00160b9a11871fb2) | feat | detect missing control flow directive imports in standalone components ([#46146](https://github.com/angular/angular/pull/46146)) | | [6b8e60c06a](https://github.com/angular/angular/commit/6b8e60c06a4f9a5fdbce9e7971d403ccb2bc6e8e) | fix | improve the missingControlFlowDirective message ([#46846](https://github.com/angular/angular/pull/46846)) | ### core | Commit | Type | Description | | -- | -- | -- | | [e8e8e5f171](https://github.com/angular/angular/commit/e8e8e5f1718f605c62a671b0ff15fa4dff7d8229) | feat | add `createComponent` function | | [b5153814af](https://github.com/angular/angular/commit/b5153814af3e6b1ec8550ddf39584efd7cca36be) | feat | add `reflectComponentType` function | | [96c6139c9a](https://github.com/angular/angular/commit/96c6139c9ab35aa6ab2330a5a79a5906d5c2e8be) | feat | add ability to set inputs on ComponentRef ([#46641](https://github.com/angular/angular/pull/46641)) | | [a6d5fe202c](https://github.com/angular/angular/commit/a6d5fe202cafb419f3beb8d09711132124b6aa9a) | feat | alias `createNgModuleRef` as `createNgModule` ([#46789](https://github.com/angular/angular/pull/46789)) | | [71e606d3c3](https://github.com/angular/angular/commit/71e606d3c3cfdcf93a6e40f84fd69aa75c5cca42) | feat | expose EnvironmentInjector on ApplicationRef ([#46665](https://github.com/angular/angular/pull/46665)) | | [19e6d9ccd3](https://github.com/angular/angular/commit/19e6d9ccd36c7776fcee7de541bba413fd6dcabf) | feat | import AsyncStackTaggingZone if available ([#46693](https://github.com/angular/angular/pull/46693)) | | [a7a14df5f8](https://github.com/angular/angular/commit/a7a14df5f8ff2d1e6a4dba3ac53f4479a6646810) | feat | introduce `EnvironmentInjector.runInContext` API ([#46653](https://github.com/angular/angular/pull/46653)) | | [fa52b6e906](https://github.com/angular/angular/commit/fa52b6e906e549e1c6b4a4f4428596d093fb0549) | feat | options object to supersede bit flags for `inject()` ([#46649](https://github.com/angular/angular/pull/46649)) | | [af20112222](https://github.com/angular/angular/commit/af20112222fcfa961ff9a2dee4050dd59aa4156e) | feat | support the descendants option for ContentChild queries ([#46638](https://github.com/angular/angular/pull/46638)) | | [945a3ad359](https://github.com/angular/angular/commit/945a3ad359cd2fe3456f635b0fe36effbfe8d5c2) | fix | Fix `runInContext` for `NgModuleRef` injector ([#46877](https://github.com/angular/angular/pull/46877)) | | [bb7c80477b](https://github.com/angular/angular/commit/bb7c80477b1258f48971b67b2eade6a4b41337f2) | fix | make parent injector argument required in `createEnvironmentInjector` ([#46397](https://github.com/angular/angular/pull/46397)) | ### http | Commit | Type | Description | | -- | -- | -- | | [82acbf919b](https://github.com/angular/angular/commit/82acbf919bae2ddb6a46f41239aa2a101901f089) | feat | improve error message for nullish header ([#46059](https://github.com/angular/angular/pull/46059)) | ### router | Commit | Type | Descrip
{ "end_byte": 350196, "start_byte": 345050, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_350196_355685
tion | | -- | -- | -- | | [53ca936366](https://github.com/angular/angular/commit/53ca936366fb908278571bae5fcc7fa08b19a5a0) | feat | Add ability to create `UrlTree` from any `ActivatedRouteSnapshot` ([#45877](https://github.com/angular/angular/pull/45877)) | | [de058bba99](https://github.com/angular/angular/commit/de058bba9979f68de2320118b537e6be4dbb888d) | feat | Add CanMatch guard to control whether a Route should match ([#46021](https://github.com/angular/angular/pull/46021)) | | [6c1357dd7d](https://github.com/angular/angular/commit/6c1357dd7d5f466575398ebc32c581068d9bf2df) | feat | Add stable cancelation code to `NavigationCancel` event ([#46675](https://github.com/angular/angular/pull/46675)) | | [a4ce273e50](https://github.com/angular/angular/commit/a4ce273e50551e6c6bc8f3a86591b04760de7ba4) | feat | Add the target `RouterStateSnapshot` to `NavigationError` ([#46731](https://github.com/angular/angular/pull/46731)) | | [abe3759e24](https://github.com/angular/angular/commit/abe3759e2417c0396d75e226edcef2fae99e363b) | fix | allow to return `UrlTree` from `CanMatchFn` ([#46455](https://github.com/angular/angular/pull/46455)) | | [e8c7dd10e9](https://github.com/angular/angular/commit/e8c7dd10e93d338456131e11d600bf758ee48634) | fix | Ensure `APP_INITIALIZER` of `enabledBlocking` option completes ([#46026](https://github.com/angular/angular/pull/46026)) | | [ce20ed067f](https://github.com/angular/angular/commit/ce20ed067f12714ee6488ffe07f1a1c18bb60a15) | fix | Ensure Route injector is created before running CanMatch guards ([#46394](https://github.com/angular/angular/pull/46394)) | | [6a7b818d94](https://github.com/angular/angular/commit/6a7b818d94fdd13d81a01285e3e4be953a29cc06) | fix | Ensure target `RouterStateSnapshot` is defined in `NavigationError` ([#46842](https://github.com/angular/angular/pull/46842)) | | [f94c6f433d](https://github.com/angular/angular/commit/f94c6f433dba3924b79f137cfcc49d2dfd4d679c) | fix | Expose CanMatchFn as public API ([#46394](https://github.com/angular/angular/pull/46394)) | | [e8ae0fe3e9](https://github.com/angular/angular/commit/e8ae0fe3e91e2e805146fad0d2f0976b1f886112) | fix | Fix cancelation code for canLoad rejections ([#46752](https://github.com/angular/angular/pull/46752)) | ### upgrade | Commit | Type | Description | | -- | -- | -- | | [e9cb0454dc](https://github.com/angular/angular/commit/e9cb0454dce2113cfd5ba11deeca6cdcf47d47f0) | feat | more closely align `UpgradeModule#bootstrap()` with `angular.bootstrap()` ([#46214](https://github.com/angular/angular/pull/46214)) | ## Special Thanks AleksanderBodurri, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Cédric Exbrayat, Dmitrij Kuba, Dylan Hunn, George Kalpakas, Jessica Janiuk, JiaLiPassion, Joey Perrott, John Vandenberg, JoostK, Keith Li, Or'el Ben-Ya'ir, Paul Gschwendtner, Pawel Kozlowski, SyedAhm3r, arturovt, mariu, markostanimirovic and mgechev <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.7"></a> # 14.0.7 (2022-07-20) ### animations | Commit | Type | Description | | -- | -- | -- | | [5bdbb6285b](https://github.com/angular/angular/commit/5bdbb6285b77f070347a5878bbd8218f6e01b5e8) | fix | make sure falsy values are added to _globalTimelineStyles ([#46863](https://github.com/angular/angular/pull/46863)) | ### compiler | Commit | Type | Description | | -- | -- | -- | | [41253f9c46](https://github.com/angular/angular/commit/41253f9c467aa9742ef0b69ddd063043fe0300e2) | fix | inputs/outputs incorrectly parsed in jit mode ([#46813](https://github.com/angular/angular/pull/46813)) | ### core | Commit | Type | Description | | -- | -- | -- | | [4e77c7fbf3](https://github.com/angular/angular/commit/4e77c7fbf38f27741617303165068e1cb1ef6354) | fix | do not invoke jasmine `done` callback multiple times with `waitForAsync` | ## Special Thanks Andrew Kushnir, Andrew Scott, Bob Watson, Cédric Exbrayat, Doug Parker, George Kalpakas, Jessica Janiuk, Kristiyan Kostadinov, Paul Gschwendtner, acvi, dario-piotrowicz, jnizet and piyush132000 <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.6"></a> # 14.0.6 (2022-07-13) ### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [99697dae66](https://github.com/angular/angular/commit/99697dae668d8df07a5c46caf08a071371131e56) | fix | only consider used pipes for inline type-check requirement ([#46807](https://github.com/angular/angular/pull/46807)) | ### forms | Commit | Type | Description | | -- | -- | -- | | [4f469cbef3](https://github.com/angular/angular/commit/4f469cbef3664746750338d167964c247151de01) | fix | expose ControlConfig in public API ([#46594](https://github.com/angular/angular/pull/46594)) | | [e8c8b695f2](https://github.com/angular/angular/commit/e8c8b695f20174a520ca1ba88164458c31e5b024) | fix | Move all remaining errors in Forms to use RuntimeErrorCode. ([#46654](https://github.com/angular/angular/pull/46654)) | ### localize | Commit | Type | Description | | -- | -- | -- | | [14863acb1a](https://github.com/angular/angular/commit/14863acb1a642e9f6d36ea5d10d64f26d84ad475) | fix | add `--project` option to `ng-add` schematic ([#46664](https://github.com/angular/angular/pull/46664)) | ## Special Thanks Alan Agius, Andrew Scott, Bob Watson, Dylan Hunn, George Kalpakas, Ivaylo Kirov, Jessica Janiuk, JoostK, Joshua VanAllen, Lukas Matta, Marcin Wosinek, Nicolas Molina Monroy, Paul Gschwendtner, SoulsMark, Uday Sony, dario-piotrowicz, markostanimirovic and zhysky <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.5"></a> # 14.0.5 (2022-07-06) ### router | Com
{ "end_byte": 355685, "start_byte": 350196, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_355685_360342
mit | Type | Description | | -- | -- | -- | | [a3bd65e2b8](https://github.com/angular/angular/commit/a3bd65e2b87a2b5676c920778598fa6afd2cda9f) | fix | Ensure `APP_INITIALIZER` of `enabledBlocking` option completes ([#46634](https://github.com/angular/angular/pull/46634)) | ## Special Thanks Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, George Kalpakas, Paul Gschwendtner and Pawel Kozlowski <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.4"></a> # 14.0.4 (2022-06-29) ### animations | Commit | Type | Description | | -- | -- | -- | | [51be9bbe29](https://github.com/angular/angular/commit/51be9bbe29e12ae0e8d4777cdac5c7466c8b6184) | fix | cleanup DOM elements when the root view is removed ([#45143](https://github.com/angular/angular/pull/45143)) | | [999aca86c8](https://github.com/angular/angular/commit/999aca86c89030b6a9023cd2835636ee487334f2) | fix | enable shadowElements to leave when their parent does ([#46459](https://github.com/angular/angular/pull/46459)) | ### common | Commit | Type | Description | | -- | -- | -- | | [42aed6b13e](https://github.com/angular/angular/commit/42aed6b13efef59c1c33472adc4f2df5d52d4c20) | fix | handle CSS custom properties in NgStyle ([#46451](https://github.com/angular/angular/pull/46451)) | ### core | Commit | Type | Description | | -- | -- | -- | | [1e7f22f00a](https://github.com/angular/angular/commit/1e7f22f00ab10a6ae01729e3355871e51bc8bf4d) | fix | trigger `ApplicationRef.destroy` when Platform is destroyed ([#46497](https://github.com/angular/angular/pull/46497)) | | [8bde2dbc71](https://github.com/angular/angular/commit/8bde2dbc714a0d9f7cda80c7893ab213d1e3f931) | fix | Update ngfor error code to be negative ([#46555](https://github.com/angular/angular/pull/46555)) | | [57e8fc00eb](https://github.com/angular/angular/commit/57e8fc00eba92618c2cf063589ba1a88d3b30055) | fix | Updates error to use RuntimeError code ([#46526](https://github.com/angular/angular/pull/46526)) | ### forms | Commit | Type | Description | | -- | -- | -- | | [74a26d870e](https://github.com/angular/angular/commit/74a26d870e2437f779c8c70f0b811f1d0bf8d4ee) | fix | Convert existing reactive errors to use RuntimeErrorCode. ([#46560](https://github.com/angular/angular/pull/46560)) | | [747872212d](https://github.com/angular/angular/commit/747872212d12660eee59024202840e7d3ebfc866) | fix | Update a Forms validator error to use RuntimeError ([#46537](https://github.com/angular/angular/pull/46537)) | ### router | Commit | Type | Description | | -- | -- | -- | | [d6fac9e914](https://github.com/angular/angular/commit/d6fac9e914ad13f1ed63ea6a3738c245e547eaae) | fix | Ensure that new `RouterOutlet` instances work after old ones are destroyed ([#46554](https://github.com/angular/angular/pull/46554)) | ## Special Thanks Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bezael, Chad Ramos, Chellappan, Cédric Exbrayat, Dylan Hunn, George Kalpakas, Jeremy Meiss, Jessica Janiuk, Joey Perrott, KMathy, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, Ramesh Thiruchelvam, Vaibhav Kumar, arturovt, dario-piotrowicz and renovate[bot] <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.3"></a> # 14.0.3 (2022-06-22) ### animations | Commit | Type | Description | | -- | -- | -- | | [3dd7bb3f8f](https://github.com/angular/angular/commit/3dd7bb3f8fa009e245bfc91aa06a485d0cb27586) | fix | reset the start and done fns on player reset ([#46364](https://github.com/angular/angular/pull/46364)) | ### core | Commit | Type | Description | | -- | -- | -- | | [c086653655](https://github.com/angular/angular/commit/c0866536558fa5abb91e1ba51fa84ea0321e6864) | fix | deduplicate imports of standalone components in JIT compiler ([#46439](https://github.com/angular/angular/pull/46439)) | | [5d3b97e1f8](https://github.com/angular/angular/commit/5d3b97e1f8d5d004621df1004e00f128064d73cd) | fix | handle NgModules with standalone pipes in TestBed correctly ([#46407](https://github.com/angular/angular/pull/46407)) | ### platform-server | Commit | Type | Description | | -- | -- | -- | | [6ad7b40a6f](https://github.com/angular/angular/commit/6ad7b40a6fe1b447173a44e7750f2b9abcb6fc0a) | fix | invalid style attribute being generated for null values ([#46433](https://github.com/angular/angular/pull/46433)) | ## Special Thanks 4javier, Aakash, Alan Agius, Andrew Kushnir, Aristeidis Bampakos, Dany Paredes, Derek Cormier, JoostK, Kristiyan Kostadinov, Paul Gschwendtner, Ramesh Thiruchelvam, behrooz bozorg chami, dario-piotrowicz, markostanimirovic, renovate[bot] and web-dave <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.2"></a> # 14.0.2 (2022-06-15) ### common | Comm
{ "end_byte": 360342, "start_byte": 355685, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_360342_362876
it | Type | Description | | -- | -- | -- | | [ef5cba3df7](https://github.com/angular/angular/commit/ef5cba3df783691433fe918f8f3c05878784c0f8) | fix | allow null in ngComponentOutlet ([#46280](https://github.com/angular/angular/pull/46280)) | ### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [8ecfd71fd7](https://github.com/angular/angular/commit/8ecfd71fd7a44628500668fbb59fdc08de8b8140) | fix | don't emit empty providers array ([#46301](https://github.com/angular/angular/pull/46301)) | | [b92c1a6ada](https://github.com/angular/angular/commit/b92c1a6adada5923b1fd69e24560ae5bfd67dd5a) | fix | use inline type-check blocks for components outside `rootDir` ([#46096](https://github.com/angular/angular/pull/46096)) | ### core | Commit | Type | Description | | -- | -- | -- | | [3fd8948b4a](https://github.com/angular/angular/commit/3fd8948b4a04dc504be3d4dd751a5554673423bb) | fix | Resolve forwardRef declarations for jit ([#46334](https://github.com/angular/angular/pull/46334)) | ## Special Thanks Alex Rickabaugh, Andrew Scott, Badawi7, Daniel Schmitz, Derek Cormier, JoostK, Kevin Davila, Kristiyan Kostadinov, Paul Draper, Paul Gschwendtner, Tom Eustace, Totati, Younes Jaaidi, alefra, dario-piotrowicz, markostanimirovic, mgechev, piyush132000, sten-bone and vivekkoya <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.1"></a> # 14.0.1 (2022-06-08) ### bazel | Commit | Type | Description | | -- | -- | -- | | [b00d237c0e](https://github.com/angular/angular/commit/b00d237c0ef726bdc262d81bcc3a3cb33181dbd9) | fix | update API extractor version ([#46259](https://github.com/angular/angular/pull/46259)) | | [9a0a7bac21](https://github.com/angular/angular/commit/9a0a7bac21decae7662a8a2ec9488f60daa97e10) | perf | reduce input files for `ng_package` rollup and type bundle actions ([#46187](https://github.com/angular/angular/pull/46187)) | ### forms | Commit | Type | Description | | -- | -- | -- | | [dde0b7f4b3](https://github.com/angular/angular/commit/dde0b7f4b3bc658b67a97644c8655252803be663) | fix | allow FormBuilder.group(...) to accept optional fields. ([#46253](https://github.com/angular/angular/pull/46253)) | ## Special Thanks Adrien Crivelli, Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Dylan Hunn, Fabrizio Fallico, George Kalpakas, Jelle Bruisten, JoostK, Kristiyan Kostadinov, Krzysztof Platis, Paul Gschwendtner, Phalgun Vaddepalli, San Leen, dario-piotrowicz, mgechev and wellWINeo <!-- CHANGELOG SPLIT MARKER --> <a name="14.0.0"></a> # 14.0.0 (2022-06-02) [Blog post "Angu
{ "end_byte": 362876, "start_byte": 360342, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_362876_369368
lar v14 is now available"](https://goo.gle/angular-v14). ## Breaking Changes ### animations - The `AnimationDriver.getParentElement` method has become required, so any implementors of this interface are now required to provide an implementation for this method. This breakage is unlikely to affect application developers, as `AnimationDriver` is not expected to be implemented in user code. ### common - Adds new required class member that any implementors of the LocationStrategy will need to satisfy. Location does not depend on PlatformLocation anymore. ### compiler - Keyframes names are now prefixed with the component's "scope name". For example, the following keyframes rule in a component definition, whose "scope name" is host-my-cmp: @keyframes foo { ... } will become: @keyframes host-my-cmp_foo { ... } Any TypeScript/JavaScript code which relied on the names of keyframes rules will no longer match. The recommended solutions in this case are to either: - change the component's view encapsulation to the `None` or `ShadowDom` - define keyframes rules in global stylesheets (e.g styles.css) - define keyframes rules programmatically in code. ### core - Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later. - TypeScript versions older than 4.6 are no longer supported. - Forms [email] input coercion Forms [email] input value will be considered as true if it is defined with any value rather than false and 'false'. - Since Ivy, TestBed doesn't use AOT summaries. The `aotSummaries` fields in TestBed APIs were present, but unused. The fields were deprecated in previous major version and in v14 those fields are removed. The `aotSummaries` fields were completely unused, so you can just drop them from the TestBed APIs usage. ### forms - Forms classes accept a generic. Forms model classes now accept a generic type parameter. Untyped versions of these classes are available to opt-out of the new, stricter behavior. - objects with a length key set to zero will no longer validate as empty. This is technically a breaking change, since objects with a key `length` and value `0` will no longer validate as empty. This is a very minor change, and any reliance on this behavior is probably a bug anyway. ### http - Queries including + will now actually query for + instead of space. Most workarounds involving custom codecs will be unaffected. Possible server-side workarounds will need to be undone. - JSONP will throw an error when headers are set on a reques JSONP does not support headers being set on requests. Before when a request was sent to a JSONP backend that had headers set the headers were ignored. The JSONP backend will now throw an error if it receives a request that has any headers set. Any uses of JSONP on requests with headers set will need to remove the headers to avoid the error. ### platform-browser - This change may cause a breaking change in unit tests that are implicitly depending on a specific number and sequence of change detections in order for their assertions to pass. - This may break invalid calls to `TransferState` methods. This tightens parameter types of `TransferState` usage, and is a minor breaking change which may reveal existing problematic calls. ### router - The type of `Route.pathMatch` is now stricter. Places that use `pathMatch` will likely need to be updated to have an explicit `Route`/`Routes` type so that TypeScript does not infer the type as `string`. - When returning a `Promise` from the `LoadChildrenCallback`, the possible type is now restricted to `Type<any>|NgModuleFactory<any>` rather than `any`. - `initialNavigation: 'enabled'` was deprecated in v11 and is replaced by `initialNavigation: 'enabledBlocking'`. - The type of `component` on `ActivatedRoute` and `ActivatedRouteSnapshot` includes `string`. In reality, this is not the case. The component cannot be anything other than a component class. - * The type of `initialUrl` is set to `string|UrlTree` but in reality, the `Router` only sets it to a value that will always be `UrlTree` * `initialUrl` is documented as "The target URL passed into the `Router#navigateByUrl()` call before navigation" but the value actually gets set to something completely different. It's set to the current internal `UrlTree` of the Router at the time navigation occurs. With this change, there is no exact replacement for the old value of `initialUrl` because it was never intended to be exposed. `Router.url` is likely the best replacement for this. In more specific use-cases, tracking the `finalUrl` between successful navigations can also be used as a replacement. - Lazy loaded configs are now also validated once loaded like the initial set of routes are. Lazy loaded modules which have invalid Route configs will now error. Note that this is only done in dev mode so there is no production impact of this change. - When a guard returns a `UrlTree`, the router would previously schedule the redirect navigation within a `setTimeout`. This timeout is now removed, which can result in test failures due to incorrectly written tests. Tests which perform navigations should ensure that all timeouts are flushed before making assertions. Tests should ensure they are capable of handling all redirects from the original navigation. - Previously, resolvers were waiting to be completed before proceeding with the navigation and the Router would take the last value emitted from the resolver. The router now takes only the first emitted value by the resolvers and then proceeds with navigation. This is now consistent with `Observables` returned by other guards: only the first value is used. ### zone.js - in TaskTrackingZoneSpec track a periodic task until it is cancelled The breaking change is scoped only to the plugin `zone.js/plugins/task-tracking`. If you used `TaskTrackingZoneSpec` and checked the pending macroTasks e.g. using `(this.ngZone as any)._inner ._parent._properties.TaskTrackingZone.getTasksFor('macroTask')`, then its behavior slightly changed for periodic macrotasks. For example, previously the `setInterval` macrotask was no longer tracked after its callback was executed for the first time. Now it's tracked until the task is explicitly cancelled, e.g with `clearInterval(id)`. ## Deprecations ### common - The `ngMod
{ "end_byte": 369368, "start_byte": 362876, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_369368_374712
uleFactory` input of the `NgComponentOutlet` directive is deprecated in favor of a newly added `ngModule` input. The `ngModule` input accepts references to the NgModule class directly, without the need to resolve module factory first. ### forms - The `initialValueIsDefault` option has been deprecated and replaced with the otherwise-identical `nonNullable` option, for the sake of naming consistency. - It is now deprecated to provide *both* `AbstractControlOption`s and an async validators argument to a FormControl. Previously, the async validators would just be silently dropped, resulting in a probably buggy forms. Now, the constructor call is deprecated, and Angular will print a warning in devmode. ### router - The `resolver` argument of the `RouterOutletContract.activateWith` function and the `resolver` field of the `OutletContext` class are deprecated. Passing component factory resolvers are no longer needed. The `ComponentFactoryResolver`-related symbols were deprecated in `@angular/core` package since v13. ### animations | Commit | Type | Description | | -- | -- | -- | | [a6fa37bc6e](https://github.com/angular/angular/commit/a6fa37bc6e705fee48f555d4b8022915094e8b16) | feat | make validateStyleProperty check dev-mode only ([#45570](https://github.com/angular/angular/pull/45570)) | | [79d334b138](https://github.com/angular/angular/commit/79d334b1385685d0fd1451534df2ed3cbaefa0b6) | feat | provide warnings for non-animatable CSS properties ([#45212](https://github.com/angular/angular/pull/45212)) | | [f8dc660605](https://github.com/angular/angular/commit/f8dc66060591e1ce42265a7862c3df16e40b05e1) | fix | allow animations with unsupported CSS properties ([#44729](https://github.com/angular/angular/pull/44729)) | | [2a75754ee8](https://github.com/angular/angular/commit/2a75754ee823032e651bc596887a2186dc6846ae) | fix | apply default params when resolved value is null or undefined ([#45339](https://github.com/angular/angular/pull/45339)) | | [e46b379204](https://github.com/angular/angular/commit/e46b37920438d84bff895498c0a102dd1ffba178) | fix | implement missing transition delay ([#44799](https://github.com/angular/angular/pull/44799)) | | [5c7c56bc85](https://github.com/angular/angular/commit/5c7c56bc859b195bf6710f6c1479d9e18dde35b1) | perf | improve algorithm to balance animation namespaces ([#45057](https://github.com/angular/angular/pull/45057)) | | [4c778cdb28](https://github.com/angular/angular/commit/4c778cdb28de128c6ddecd2fd6cb6257d675500b) | perf | made errors in the animations package tree shakeable ([#45004](https://github.com/angular/angular/pull/45004)) | | [7a81481fb2](https://github.com/angular/angular/commit/7a81481fb29e94b550db7ad68270eccf26bb2743) | perf | Remove generic objects in favor of Maps ([#44482](https://github.com/angular/angular/pull/44482)) | | [6642e3c8fd](https://github.com/angular/angular/commit/6642e3c8fd7d3b5ed22710667b2c41a46f14eda8) | perf | remove no longer needed CssKeyframes classes ([#44903](https://github.com/angular/angular/pull/44903)) | | [59559fdbac](https://github.com/angular/angular/commit/59559fdbacc00bee380b1e88c79d08b6e856ebbe) | refactor | make `AnimationDriver.getParentElement` required ([#45114](https://github.com/angular/angular/pull/45114)) | ### common | Commit | Type | Description | | -- | -- | -- | | [31d7c3bd71](https://github.com/angular/angular/commit/31d7c3bd71fdab3fef1b4615ecb8124fe6c165bd) | feat | add getState method to LocationStrategy interface ([#45648](https://github.com/angular/angular/pull/45648)) | | [c89cf63059](https://github.com/angular/angular/commit/c89cf63059370bba43717483e3d9627499dfe815) | feat | support NgModule as an input to the NgComponentOutlet ([#44815](https://github.com/angular/angular/pull/44815)) | | [38c03a2035](https://github.com/angular/angular/commit/38c03a20358db3f8621c023b98e627cd385731c0) | feat | support years greater than 9999 ([#43622](https://github.com/angular/angular/pull/43622)) | | [bedb257afc](https://github.com/angular/angular/commit/bedb257afc1ca12eb221536ea44ade960e62cda0) | fix | cleanup URL change listeners when the root view is removed ([#44901](https://github.com/angular/angular/pull/44901)) | | [10691c626b](https://github.com/angular/angular/commit/10691c626bf381bedfa278e9d50ab922b4b656cd) | fix | properly cast http param values to strings ([#42643](https://github.com/angular/angular/pull/42643)) | | [05d50b849b](https://github.com/angular/angular/commit/05d50b849bb891c37c3eefab81a45099057dfd78) | perf | make `NgLocalization` token tree-shakable ([#45118](https://github.com/angular/angular/pull/45118)) | ### compiler | Commit | Type | Description | | -- | -- | -- | | [bb8d7091c6](https://github.com/angular/angular/commit/bb8d7091c64a785758ae347b1a9bcdeeed95897c) | fix | exclude empty styles from emitted metadata ([#45459](https://github.com/angular/angular/pull/45459)) | | [4d6a1d6722](https://github.com/angular/angular/commit/4d6a1d672210219328b33f4f96210870563066ee) | fix | scope css keyframes in emulated view encapsulation ([#42608](https://github.com/angular/angular/pull/42608)) | | [f03e313f24](https://github.com/angular/angular/commit/f03e313f24465cbe9ce99aa5f9f482a6c6b5485f) | fix | scope css keyframes in emulated view encapsulation ([#42608](https://github.com/angular/angular/pull/42608)) | ### compiler-cli | Commit | Type | Desc
{ "end_byte": 374712, "start_byte": 369368, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_374712_378519
ription | | -- | -- | -- | | [9cf14ff03d](https://github.com/angular/angular/commit/9cf14ff03dc7a848413b323dfb943fcd26f1217e) | feat | exclude abstract classes from `strictInjectionParameters` requirement ([#44615](https://github.com/angular/angular/pull/44615)) | | [0072eb48ba](https://github.com/angular/angular/commit/0072eb48ba1c6f549703988b7fd7ba3e09058048) | feat | initial implementation of standalone components ([#44812](https://github.com/angular/angular/pull/44812)) | | [2142ffd295](https://github.com/angular/angular/commit/2142ffd295de491eb8582c2eb1712b5b48044f24) | feat | propagate `standalone` flag to runtime ([#44973](https://github.com/angular/angular/pull/44973)) | | [6f653e05f9](https://github.com/angular/angular/commit/6f653e05f985141ae4d2d90af78b2bc001595661) | feat | standalone types imported into NgModule scopes ([#44973](https://github.com/angular/angular/pull/44973)) | | [752ddbc165](https://github.com/angular/angular/commit/752ddbc165359c2ff987c24f715d0a36fd604ec0) | feat | Support template binding to protected component members ([#45823](https://github.com/angular/angular/pull/45823)) | | [3d13343975](https://github.com/angular/angular/commit/3d133439754cbf5d5a20bb3c714c8673c848e465) | fix | better error messages for NgModule structural issues ([#44973](https://github.com/angular/angular/pull/44973)) | | [046dad1a8d](https://github.com/angular/angular/commit/046dad1a8d878ea537a6e2ef5f5ef24a85a2cf02) | fix | fix issue with incremental tracking of APIs for pipes ([#45672](https://github.com/angular/angular/pull/45672)) | | [27b4af7240](https://github.com/angular/angular/commit/27b4af7240ea964d1e4d51b83118f10321163627) | fix | full side-effectful registration of NgModules with ids ([#45024](https://github.com/angular/angular/pull/45024)) | | [32c625d027](https://github.com/angular/angular/commit/32c625d0279d9fd55178ced47c45969da533eedc) | fix | handle forwardRef in imports of standalone component ([#45869](https://github.com/angular/angular/pull/45869)) | | [06050ac2b4](https://github.com/angular/angular/commit/06050ac2b4937836096fb331ec71bacb5a1fc231) | fix | handle inline type-check blocks in nullish coalescing extended check ([#45454](https://github.com/angular/angular/pull/45454)) | | [a524a50361](https://github.com/angular/angular/commit/a524a50361bb408cf8baf8ff209378a1db967545) | fix | handle standalone components with cycles ([#46029](https://github.com/angular/angular/pull/46029)) | | [724e88e042](https://github.com/angular/angular/commit/724e88e042b1a89691d48879673b5e1b161c3d9a) | fix | preserve `forwardRef` for component scopes ([#46139](https://github.com/angular/angular/pull/46139)) | | [9cfea3d522](https://github.com/angular/angular/commit/9cfea3d522c0e4a34bb3a5d0fa9d04f64de39b49) | fix | report invalid imports in standalone components during resolve phase ([#45827](https://github.com/angular/angular/pull/45827)) | | [c0778b4dfc](https://github.com/angular/angular/commit/c0778b4dfc1c107543b3db6f1958814a0812c7df) | fix | Support resolve animation name from the DTS ([#45107](https://github.com/angular/angular/pull/45107)) | | [f2e5234e07](https://github.com/angular/angular/commit/f2e5234e078b6d4771d07e8b28b8098f1faeb176) | fix | update unknown tag error for aot standalone components ([#45919](https://github.com/angular/angular/pull/45919)) | | [35f20afcac](https://github.com/angular/angular/commit/35f20afcac4877963e4a3e5d85b67ed8cb000af9) | fix | use existing imports for standalone dependencies ([#46029](https://github.com/angular/angular/pull/46029)) | | [8155428ba6](https://github.com/angular/angular/commit/8155428ba65c38c0c15f2666727202a7b360c1bd) | perf | ignore the module.id anti-pattern for NgModule ids ([#45024](https://github.com/angular/angular/pull/45024)) | ### core | Commit | Type | Description
{ "end_byte": 378519, "start_byte": 374712, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_378519_384395
| | -- | -- | -- | | [174ce7dd13](https://github.com/angular/angular/commit/174ce7dd13f6d8f941d3aa0b843559614cb68b0c) | feat | add `ApplicationRef.destroy` method ([#45624](https://github.com/angular/angular/pull/45624)) | | [5771b18a98](https://github.com/angular/angular/commit/5771b18a989c3c75d713ffb75cd7c047c63e4090) | feat | add the `bootstrapApplication` function ([#45674](https://github.com/angular/angular/pull/45674)) | | [69018c9f42](https://github.com/angular/angular/commit/69018c9f42d14c1c7aa8271b406d6d247de1c564) | feat | allow for injector to be specified when creating an embedded view ([#45156](https://github.com/angular/angular/pull/45156)) | | [94c949a60a](https://github.com/angular/angular/commit/94c949a60ad0de1f5385ec97f2c1933cb1d55f22) | feat | allow for injector to be specified when creating an embedded view ([#45156](https://github.com/angular/angular/pull/45156)) | | [e702cafcf2](https://github.com/angular/angular/commit/e702cafcf2fef53968ef52ce17cb343f3a12bb53) | feat | allow to throw on unknown elements in tests ([#45479](https://github.com/angular/angular/pull/45479)) | | [6662a97c61](https://github.com/angular/angular/commit/6662a97c61f133a14f2d117f71e4d2b8f4a83c32) | feat | allow to throw on unknown elements in tests ([#45479](https://github.com/angular/angular/pull/45479)) | | [a6675925b0](https://github.com/angular/angular/commit/a6675925b0b6f313d4932a753bd4aa4cb473b5f3) | feat | allow to throw on unknown properties in tests ([#45853](https://github.com/angular/angular/pull/45853)) | | [6eaaefd22e](https://github.com/angular/angular/commit/6eaaefd22ebb95ee896a62237832ff2f2defdee0) | feat | drop support for Node.js 12 ([#45286](https://github.com/angular/angular/pull/45286)) | | [c9d566ce4b](https://github.com/angular/angular/commit/c9d566ce4b6e9097d9eceb7ac3964a0b25c404ad) | feat | drop support for TypeScript 4.4 and 4.5 ([#45394](https://github.com/angular/angular/pull/45394)) | | [b568a5e708](https://github.com/angular/angular/commit/b568a5e708579f5035f40c7218fbba39ad6b3065) | feat | implement `importProvidersFrom` function ([#45626](https://github.com/angular/angular/pull/45626)) | | [d5a6cd1111](https://github.com/angular/angular/commit/d5a6cd11110c78762a8e6115a718f5851508dbf2) | feat | implement EnvironmentInjector with adapter to NgModuleRef ([#45626](https://github.com/angular/angular/pull/45626)) | | [5a10fc4f82](https://github.com/angular/angular/commit/5a10fc4f8287d448c88ce2f6c97c48307af34af1) | feat | implement standalone directives, components, and pipes ([#45687](https://github.com/angular/angular/pull/45687)) | | [e461f716d4](https://github.com/angular/angular/commit/e461f716d4b736829d53de26ba6dddb58f476746) | feat | move ANIMATION_MODULE_TYPE injection token into core ([#44970](https://github.com/angular/angular/pull/44970)) | | [94bba76a4a](https://github.com/angular/angular/commit/94bba76a4a9594a5eb90e581f407f1b70697e715) | feat | support TypeScript 4.6 ([#45190](https://github.com/angular/angular/pull/45190)) | | [29039fcdbc](https://github.com/angular/angular/commit/29039fcdbcb8cab040d88dabe2dcb1abae34cb4e) | feat | support TypeScript 4.7 ([#45749](https://github.com/angular/angular/pull/45749)) | | [225e4f2dbe](https://github.com/angular/angular/commit/225e4f2dbeac5982982fb94eac65ea931c44247a) | feat | triggerEventHandler accept optional eventObj ([#45279](https://github.com/angular/angular/pull/45279)) | | [401dec46eb](https://github.com/angular/angular/commit/401dec46eb71e33ae3ef185b8f92ed2b3b7661fd) | feat | update TestBed to recognize Standalone Components ([#45809](https://github.com/angular/angular/pull/45809)) | | [35653ce337](https://github.com/angular/angular/commit/35653ce337b59336ebb06f07dfed027e5037ed06) | fix | add more details to the MISSING_INJECTION_CONTEXT error ([#46166](https://github.com/angular/angular/pull/46166)) | | [d36fa111eb](https://github.com/angular/angular/commit/d36fa111eb677d504a9952d8b4ca53560cadd04d) | fix | avoid Closure Compiler error in restoreView ([#45445](https://github.com/angular/angular/pull/45445)) | | [0bc77f4cab](https://github.com/angular/angular/commit/0bc77f4cabb3fe76accb120f7aba57ebfee9262b) | fix | better error message when unknown property is present ([#46147](https://github.com/angular/angular/pull/46147)) | | [f3eb7d9ecb](https://github.com/angular/angular/commit/f3eb7d9ecb9a82e7396cca658e3250e47c853153) | fix | Ensure the `StandaloneService` is retained after closure minification ([#45783](https://github.com/angular/angular/pull/45783)) | | [701405fa71](https://github.com/angular/angular/commit/701405fa710177ed1c963f61686ebb910e5ec74e) | fix | handle AOT-compiled standalone components in TestBed correctly ([#46052](https://github.com/angular/angular/pull/46052)) | | [ddce357d1d](https://github.com/angular/angular/commit/ddce357d1db9694bc69c114deb96e26d2651fb8b) | fix | improve TestBed declarations standalone error message ([#45999](https://github.com/angular/angular/pull/45999)) | | [ba9f30c9a6](https://github.com/angular/angular/commit/ba9f30c9a6af19b34d13962303ec96997c7c3d56) | fix | include component name into unknown element/property error message ([#46160](https://github.com/angular/angular/pull/46160)) | | [9fa6f5a552](https://github.com/angular/angular/commit/9fa6f5a552b7780ce32aa5a60273d4008a7b6afb) | fix | incorrectly inserting elements inside `<template>` element ([#43429](https://github.com/angular/angular/pull/43429)) | | [d5719c2e0f](https://github.com/angular/angular/commit/d5719c2e0fb237be71d658444bbfe2410e05086a) | fix | input coercion ([#42803](https://github.com/angular/angular/pull/42803)) | | [be161bef79](https://github.com/angular/angular/commit/be161bef798ac5309df8390e3c2bba2cf84cb530) | fix | memory leak in event listeners inside embedded views ([#43075](https://github.com/angular/angular/pull/43075)) | | [fa755b2a54](https://github.com/angu
{ "end_byte": 384395, "start_byte": 378519, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_384396_388247
ar/angular/commit/fa755b2a541274336541e8870852e73718ad62d4) | fix | prevent `BrowserModule` providers from being loaded twice ([#45826](https://github.com/angular/angular/pull/45826)) | | [3172b4cc99](https://github.com/angular/angular/commit/3172b4cc9972a7d347b3078484c9adcb15cf270c) | fix | produce proper error message for unknown props on `<ng-template>`s ([#46068](https://github.com/angular/angular/pull/46068)) | | [4f1a813596](https://github.com/angular/angular/commit/4f1a813596a40f7885d369eb8917aedcce9dd795) | fix | restore NgModule state correctly after TestBed overrides ([#46049](https://github.com/angular/angular/pull/46049)) | | [3f7ecec59b](https://github.com/angular/angular/commit/3f7ecec59b894d2a92f4b5643d2a23891938bde8) | fix | set correct context for inject() for component ctors ([#45991](https://github.com/angular/angular/pull/45991)) | | [4e413d9240](https://github.com/angular/angular/commit/4e413d9240259fca1b1e548c5c405e646f8e68c8) | fix | support nested arrays of providers in `EnvironmentInjector` ([#45789](https://github.com/angular/angular/pull/45789)) | | [fde4942cdf](https://github.com/angular/angular/commit/fde4942cdf5133119b13ed26ee2f6976b787d84c) | fix | throw if standalone components are present in `@NgModule.bootstrap` ([#45825](https://github.com/angular/angular/pull/45825)) | | [560188bf12](https://github.com/angular/angular/commit/560188bf126f259328477773cabb367587a257d5) | fix | update unknown property error to account for standalone components in AOT ([#46159](https://github.com/angular/angular/pull/46159)) | | [df339d8abf](https://github.com/angular/angular/commit/df339d8abf979c715c35db813c5a80252a92eba7) | fix | update unknown tag error for jit standalone components ([#45920](https://github.com/angular/angular/pull/45920)) | | [aafac7228f](https://github.com/angular/angular/commit/aafac7228f3d18bb720e85d2b889df446122f4c7) | fix | verify standalone component imports in JiT ([#45777](https://github.com/angular/angular/pull/45777)) | | [e9317aee71](https://github.com/angular/angular/commit/e9317aee71f64f4aadea0529601e589b37f6b46f) | perf | allow `checkNoChanges` mode to be tree-shaken in production ([#45913](https://github.com/angular/angular/pull/45913)) | | [071c8af8ba](https://github.com/angular/angular/commit/071c8af8ba89163270f17657c0c7f1c944f186f7) | perf | avoid storing LView in `__ngContext__` ([#45051](https://github.com/angular/angular/pull/45051)) | | [a96c4827c4](https://github.com/angular/angular/commit/a96c4827c4f62e1d665d8544a3e66c51d2644c88) | perf | make `Compiler`, `ApplicationRef` and `ApplicationInitStatus` tree-shakable ([#45102](https://github.com/angular/angular/pull/45102)) | | [45d98e7ca5](https://github.com/angular/angular/commit/45d98e7ca5accf918e2602cbc17805e11e18896b) | perf | make `IterableDiffers` and `KeyValueDiffers` tree-shakable ([#45094](https://github.com/angular/angular/pull/45094)) | | [1e60fe0a3e](https://github.com/angular/angular/commit/1e60fe0a3eeb6bd46997f7eeb4825351cfbe3c44) | perf | make `LOCALE_ID` and other tokens from `ApplicationModule` tree-shakable ([#45102](https://github.com/angular/angular/pull/45102)) | | [88f1168506](https://github.com/angular/angular/commit/88f1168506befd0665125da1fca2a719cb27dbb5) | perf | only track LViews that are referenced in `__ngContext__` ([#45172](https://github.com/angular/angular/pull/45172)) | | [9add714b13](https://github.com/angular/angular/commit/9add714b13740db621eb2b200d72be74cc7eb630) | refactor | remove deprecated `aotSummaries` fields in TestBed config ([#45487](https://github.com/angular/angular/pull/45487)) | ### devtools tabs | Commit | Type | Description | | -- | -- | -- | | [6c284ef32e](https://github.com/angular/angular/commit/6c284ef32e53a8dabbc368b9cf69f1b6f1a377b7) | fix | stop scroll occuring at tabs level | ### forms | Commit | Type | Description
{ "end_byte": 388247, "start_byte": 384396, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_388247_394016
| | -- | -- | -- | | [2dbdebc646](https://github.com/angular/angular/commit/2dbdebc6467074c7005c09ef5c229029f8d3607c) | feat | Add `FormBuilder.nonNullable`. ([#45852](https://github.com/angular/angular/pull/45852)) | | [e0a2248b32](https://github.com/angular/angular/commit/e0a2248b3233b5d384f33859ef6207613cad909d) | feat | Add a FormRecord type. ([#45607](https://github.com/angular/angular/pull/45607)) | | [7ee121f595](https://github.com/angular/angular/commit/7ee121f595a47338b31098ae51a6f91d80c8fdce) | feat | Add untyped versions of the model classes for use in migration. ([#45205](https://github.com/angular/angular/pull/45205)) | | [89d299105a](https://github.com/angular/angular/commit/89d299105a4ae11985fb809f42cd0e34511207c9) | feat | Implement strict types for the Angular Forms package. ([#43834](https://github.com/angular/angular/pull/43834)) | | [f490c2de4e](https://github.com/angular/angular/commit/f490c2de4e1ada26e62e35c0d70cb90e55297658) | feat | support negative indices in FormArray methods. ([#44848](https://github.com/angular/angular/pull/44848)) | | [39be06037d](https://github.com/angular/angular/commit/39be06037daf65ae9298b5bdb4cd50785c16332f) | fix | Add a `nonNullable` option to `FormControl` for consistency. | | [4332897baa](https://github.com/angular/angular/commit/4332897baa2226ef246ee054fdd5254e3c129109) | fix | Add UntypedFormBuilder ([#45268](https://github.com/angular/angular/pull/45268)) | | [5d13e58aed](https://github.com/angular/angular/commit/5d13e58aed8b7641f0b2d4f0c9015cb90ff4edb5) | fix | Allow NonNullableFormBuilder to be injected. ([#45904](https://github.com/angular/angular/pull/45904)) | | [8dd3f82f94](https://github.com/angular/angular/commit/8dd3f82f946bae86dc6c678d8694ab73d915bbfa) | fix | Correct empty validator to handle objects with a property `length: 0`. ([#33729](https://github.com/angular/angular/pull/33729)) | | [ff3f5a8d12](https://github.com/angular/angular/commit/ff3f5a8d12e3243620e311b690a050e26493e539) | fix | Fix a typing bug in FormBuilder. ([#45684](https://github.com/angular/angular/pull/45684)) | | [fe0e42a996](https://github.com/angular/angular/commit/fe0e42a996d5b70f4c0923cb6570c9a8032b1298) | fix | Make UntypedFormBuilder assignable to FormBuilder, and vice versa. ([#45421](https://github.com/angular/angular/pull/45421)) | | [b36dec6b5b](https://github.com/angular/angular/commit/b36dec6b5b05de0d40581726c59db9f962a97124) | fix | not picking up disabled state if group is swapped out and disabled ([#43499](https://github.com/angular/angular/pull/43499)) | | [9f6fa5b746](https://github.com/angular/angular/commit/9f6fa5b746cbdd4a71f67728ff6b663ad26c6a29) | fix | Prevent FormBuilder from distributing unions to control types. ([#45942](https://github.com/angular/angular/pull/45942)) | | [aa7b857be8](https://github.com/angular/angular/commit/aa7b857be89a62e6dcfe62c418acf0823525d265) | fix | Property renaming safe code ([#45271](https://github.com/angular/angular/pull/45271)) | | [cae1e44608](https://github.com/angular/angular/commit/cae1e44608227ac80682401190c6d28ef39b3269) | fix | Update the typed forms migration to use `FormArray<T>` instead of `FormArray<T[]>`. ([#44933](https://github.com/angular/angular/pull/44933)) | | [d336ba96d9](https://github.com/angular/angular/commit/d336ba96d922363235688f54d8af108ef7ab01f0) | fix | Update the typed forms migration. ([#45281](https://github.com/angular/angular/pull/45281)) | | [018550ed50](https://github.com/angular/angular/commit/018550ed5025de9737794b683eb7c0697d83d430) | fix | Value and RawValue should be part of the public API. ([#45978](https://github.com/angular/angular/pull/45978)) | | [2e96cede3e](https://github.com/angular/angular/commit/2e96cede3e2d9ac399c10d3bfe25259b92a5276e) | fix | Warn on FormControls that are constructed with both options and asyncValidators. | ### http | Commit | Type | Description | | -- | -- | -- | | [76a9a24cdc](https://github.com/angular/angular/commit/76a9a24cdcb87e36868e2e29d1831af2dec3a818) | fix | encode + signs in query params as %2B (angular[#11058](https://github.com/angular/angular/pull/11058)) ([#45111](https://github.com/angular/angular/pull/45111)) | | [d43c0e973f](https://github.com/angular/angular/commit/d43c0e973f4389c74eb19a7f6b667bd2e1d380fe) | fix | Throw error when headers are supplied in JSONP request ([#45210](https://github.com/angular/angular/pull/45210)) | ### language-service | Commit | Type | Description | | -- | -- | -- | | [9d4af65e34](https://github.com/angular/angular/commit/9d4af65e343e41b48cb9afd12c2b61d8ca61a9ac) | feat | Provide plugin to delegate rename requests to Angular ([#44696](https://github.com/angular/angular/pull/44696)) | | [3ae133c69e](https://github.com/angular/angular/commit/3ae133c69e1c78d5ddf772cacf222f909faccd70) | fix | Fix detection of Angular for v14+ projects ([#45998](https://github.com/angular/angular/pull/45998)) | ### localize | Commit | Type | Description | | -- | -- | -- | | [a50e2da64a](https://github.com/angular/angular/commit/a50e2da64a4297d1bc994a267203c2097da2efaf) | fix | ensure transitively loaded compiler code is tree-shakable ([#45405](https://github.com/angular/angular/pull/45405)) | ### migrations | Commit | Type | Description | | -- | -- | -- | | [d56a537196](https://github.com/angular/angular/commit/d56a537196d2ab0f3f48821889020d2f5bc621ba) | feat | Add migration to add explicit `Route`/`Routes` type ([#45084](https://github.com/angular/angular/pull/45084)) | ### ngcc | Commit | Type | Description | | -- | -- | -- | | [74a2e2e2ec](https://github.com/angular/angular/commit/74a2e2e2ecb81a31c7fbec42d7770937b09e33a4) | fix | cope with packages following APF v14+ ([#45833](https://github.com/angular/angular/pull/45833)) | ### platform-browser | Commit | Type |
{ "end_byte": 394016, "start_byte": 388247, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_394016_399703
Description | | -- | -- | -- | | [a01bcb8e7e](https://github.com/angular/angular/commit/a01bcb8e7eaf63ac9466a78dd4d15228241da900) | fix | do not run change detection when loading Hammer ([#44921](https://github.com/angular/angular/pull/44921)) | | [b32647dc68](https://github.com/angular/angular/commit/b32647dc68b055da0c49c86d6e7e2a7d2ec5954a) | fix | Make transfer state key typesafe. ([#23020](https://github.com/angular/angular/pull/23020)) | | [c7bf75dd5e](https://github.com/angular/angular/commit/c7bf75dd5e7f3f80a3c2afb8586ae46f7258f349) | fix | remove obsolete shim for Map comparison in Jasmine ([#45521](https://github.com/angular/angular/pull/45521)) | | [23c4c9601e](https://github.com/angular/angular/commit/23c4c9601e1bdd8bd2e37d9e0468440a44971b95) | perf | avoid including Testability by default in `bootstrapApplication` ([#45885](https://github.com/angular/angular/pull/45885)) | ### platform-server | Commit | Type | Description | | -- | -- | -- | | [dff5586d52](https://github.com/angular/angular/commit/dff5586d5243f914b9054b5ab7ac71d57edfa973) | feat | implement `renderApplication` function ([#45785](https://github.com/angular/angular/pull/45785)) | | [22c71be94c](https://github.com/angular/angular/commit/22c71be94c3a695ca0cd0316065d807abb46355f) | fix | update `renderApplication` to move `appId` to options ([#45844](https://github.com/angular/angular/pull/45844)) | ### router | Commit | Type | Description | | -- | -- | -- | | [f4fd1a8262](https://github.com/angular/angular/commit/f4fd1a82620b5b3899c5e8c89fa06b084ee5792e) | feat | Add `EnvironmentInjector` to `RouterOutlet.activateWith` ([#45597](https://github.com/angular/angular/pull/45597)) | | [910de8bc33](https://github.com/angular/angular/commit/910de8bc3379b1452c0bc23a866b5108d6d94e55) | feat | Add `Route.title` with a configurable `TitleStrategy` ([#43307](https://github.com/angular/angular/pull/43307)) | | [4e0957a4e1](https://github.com/angular/angular/commit/4e0957a4e10d1ae188faa843043a2314c9873c52) | feat | Add ability to specify providers on a Route ([#45673](https://github.com/angular/angular/pull/45673)) | | [dea8c86cd5](https://github.com/angular/angular/commit/dea8c86cd57f8e1720634928805f9ea0ba8f0baa) | feat | add ariaCurrentWhenActive input to RouterLinkActive directive ([#45167](https://github.com/angular/angular/pull/45167)) | | [41e2a68e30](https://github.com/angular/angular/commit/41e2a68e30c12e5ad3e26047c3a4032e9aa1a6e1) | feat | add type properties to all router events ([#44189](https://github.com/angular/angular/pull/44189)) | | [4962a4a332](https://github.com/angular/angular/commit/4962a4a3324d5972f364d768b38b21a33fdb7d7c) | feat | Allow `loadChildren` to return a `Route` array ([#45700](https://github.com/angular/angular/pull/45700)) | | [791bd31424](https://github.com/angular/angular/commit/791bd3142432ed7caf14a68a6e434b27004e634b) | feat | set stricter type for Route.title ([#44939](https://github.com/angular/angular/pull/44939)) | | [50004c143b](https://github.com/angular/angular/commit/50004c143ba9b1e041c7b30caf98f6582d3d26d4) | feat | Support lazy loading standalone components with `loadComponent` ([#45705](https://github.com/angular/angular/pull/45705)) | | [7fd416d060](https://github.com/angular/angular/commit/7fd416d060bd873bc88dffed41946c51aa649ec1) | fix | Fix type of Route.pathMatch to be more accurate ([#45176](https://github.com/angular/angular/pull/45176)) | | [1c11a57155](https://github.com/angular/angular/commit/1c11a5715576632a4fb7170202395cf95dfbce09) | fix | merge interited resolved data and static data ([#45276](https://github.com/angular/angular/pull/45276)) | | [f8f3ab377b](https://github.com/angular/angular/commit/f8f3ab377b8842c2bae0f215a0e90aaa3a1e070a) | fix | Remove `any` from `LoadChildrenCallback` type ([#45524](https://github.com/angular/angular/pull/45524)) | | [d4fc12fa19](https://github.com/angular/angular/commit/d4fc12fa19dbe5e89189bb52c37e5d37a00a663c) | fix | Remove deprecated initialNavigation option ([#45729](https://github.com/angular/angular/pull/45729)) | | [989e840cce](https://github.com/angular/angular/commit/989e840cce7ebe94311ae898786e09b1b41ce7f6) | fix | Remove unused string type for ActivatedRoute.component ([#45625](https://github.com/angular/angular/pull/45625)) | | [64f837d2c0](https://github.com/angular/angular/commit/64f837d2c0fbcf722d32b35a87e87220bfe61f65) | fix | Update `Navigation#initialUrl` to match documentation and reality ([#43863](https://github.com/angular/angular/pull/43863)) | | [96fd29c6d2](https://github.com/angular/angular/commit/96fd29c6d2d2abc5afee4d21a3e964a79aa39844) | fix | validate lazy loaded configs ([#45526](https://github.com/angular/angular/pull/45526)) | | [f13295f3a3](https://github.com/angular/angular/commit/f13295f3a3a1d622d15cf8339360d53feba824b5) | perf | cancel the navigation instantly if at least one resolver doesn't emit any value ([#45621](https://github.com/angular/angular/pull/45621)) | | [1d2f5c1101](https://github.com/angular/angular/commit/1d2f5c1101ccd182f5b528de52583a1b98dd6789) | refactor | deprecate no longer needed resolver fields ([#45597](https://github.com/angular/angular/pull/45597)) | | [7b367d9d90](https://github.com/angular/angular/commit/7b367d9d908e15222645a45e2ba133b9d9da76b7) | refactor | Remove unnecessary setTimeout in UrlTree redirects ([#45735](https://github.com/angular/angular/pull/45735)) | | [c9679760b2](https://github.com/angular/angular/commit/c9679760b2bf5c607c957c20482b9cea7a21702b) | refactor | take only the first emitted value of every resolver to make it consistent with guards ([#44573](https://github.com/angular/angular/pull/44573)) | ### service-worker | Commit | Type | De
{ "end_byte": 399703, "start_byte": 394016, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/CHANGELOG.md_399703_401291
scription | | -- | -- | -- | | [ec0a0e0669](https://github.com/angular/angular/commit/ec0a0e0669ef5d2f524fbf9a540eb2b306b2e24a) | feat | add `cacheOpaqueResponses` option for data-groups ([#44723](https://github.com/angular/angular/pull/44723)) | | [bd04fbc05b](https://github.com/angular/angular/commit/bd04fbc05b0397de966a493a863e1054203c86d9) | feat | emit a notification when the service worker is already up-to-date after check ([#45216](https://github.com/angular/angular/pull/45216)) | ## Special Thanks Adrian Kunz, Alan Agius, AleksanderBodurri, Alex Rickabaugh, AlirezaEbrahimkhani, Amir Rustamzadeh, Andrew Kushnir, Andrew Scott, Chabbey François, Charles Lyding, Cédric Exbrayat, Daan De Smedt, David Schmidt, Derek Cormier, Dmitrij Kuba, Doug Parker, Dylan Hunn, Emma Twersky, George Kalpakas, George Looshch, Jan Kuehle, Jessica Janiuk, JiaLiPassion, JimMorrison723, Joe Martin (Crowdstaffing), Joey Perrott, JoostK, Kristiyan Kostadinov, Krzysztof Platis, Leosvel Pérez Espinosa, Maddie Klein, Mark Whitfeld, Martin Sikora, Michael-Doner, Michal Materowski, Minko Gechev, Paul Gschwendtner, Pawel Kozlowski, Payam Shahidi, Pusztai Tibor, Ricardo Mattiazzi Baumgartner, Roy Dorombozi, Ruslan Lekhman, Samuel Littley, Sergej Grilborzer, Sumit Arora, Tobias Speicher, Virginia Dooley, Zack Elliott, alirezaghey, ananyahs96, arturovt, cexbrayat, dario-piotrowicz, ivanwonder, kamikopi, markostanimirovic, markwhitfeld, mgechev, renovate[bot], twerske and zverbeta Earlier changelog entries can be found in CHANGELOG_ARCHIVE.md file.
{ "end_byte": 401291, "start_byte": 399703, "url": "https://github.com/angular/angular/blob/main/CHANGELOG.md" }
angular/browser-providers.conf.d.ts_0_387
type CustomLauncher = { base: string; browserName: string; platformName: string; platformVersion: string; deviceName: string; appiumVersion: string; extendedDebugging: boolean; } type CustomLaunchers = { [string]: CustomLauncher; }; type SauceAliases = { [string]: string[]; }; export const customLaunchers: CustomLaunchers; export const sauceAliases: SauceAliases;
{ "end_byte": 387, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/browser-providers.conf.d.ts" }
angular/WORKSPACE_0_5920
workspace( name = "angular", managed_directories = { "@npm": ["node_modules"], }, ) load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("//:yarn.bzl", "YARN_LABEL") http_archive( name = "build_bazel_rules_nodejs", patches = [ "//tools/esm-interop:patches/bazel/nodejs_binary_esm_support.patch", ], sha256 = "5dd1e5dea1322174c57d3ca7b899da381d516220793d0adef3ba03b9d23baa8e", urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.3/rules_nodejs-5.8.3.tar.gz"], ) load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") build_bazel_rules_nodejs_dependencies() # The PKG rules are needed to build tar packages for integration tests. The builtin # rule in `@bazel_tools` is not Windows compatible and outdated. # NOTE: We cannot move past version 0.6.0 as pkg_tar no longer works on directories, which rules_nodejs # relies on for node_modules setup. http_archive( name = "rules_pkg", sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz", "https://github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz", ], ) # Fetch Aspect lib for utilities like write_source_files # NOTE: We cannot move past version 1.23.2 of aspect_bazel_lib because it requires us to move to bazel 6.0.0 which # breaks our usage of managed_directories http_archive( name = "aspect_bazel_lib", sha256 = "4b2e774387bae6242879820086b7b738d49bf3d0659522ea5d9363be01a27582", strip_prefix = "bazel-lib-1.23.2", url = "https://github.com/aspect-build/bazel-lib/archive/refs/tags/v1.23.2.tar.gz", ) # Setup the Node.js toolchain. load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") nodejs_register_toolchains( name = "nodejs", node_repositories = { "18.20.0-darwin_arm64": ("node-v18.20.0-darwin-arm64.tar.gz", "node-v18.20.0-darwin-arm64", "10066ad4dd9e03ea5c4c45ef8775420ff37b860de09bbdf87b97e0c07b1ea036"), "18.20.0-darwin_amd64": ("node-v18.20.0-darwin-x64.tar.gz", "node-v18.20.0-darwin-x64", "062ba71618e88e06321de5caa038843c350aababa2d315f3ca7b8551f8e66c1c"), "18.20.0-linux_arm64": ("node-v18.20.0-linux-arm64.tar.xz", "node-v18.20.0-linux-arm64", "afe51da9ffb38ac1e3a20d9a06efd403ced4bf8831ab554a02a088dd8392fd79"), "18.20.0-linux_ppc64le": ("node-v18.20.0-linux-ppc64le.tar.xz", "node-v18.20.0-linux-ppc64le", "9e652bbf53a3e37285b11dfb9d6a9bb8b02010c3b50e5c8229d4cc10e72681da"), "18.20.0-linux_s390x": ("node-v18.20.0-linux-s390x.tar.xz", "node-v18.20.0-linux-s390x", "a6c2a5796b9d9e9bf21da62ec89ff30b41a8108880b9eaa3c912f1ce795a7743"), "18.20.0-linux_amd64": ("node-v18.20.0-linux-x64.tar.xz", "node-v18.20.0-linux-x64", "03eea148e56785babb27930b05ed6bf311aaa3bc573c0399dd63cad2fe5713c7"), "18.20.0-windows_amd64": ("node-v18.20.0-win-x64.zip", "node-v18.20.0-win-x64", "1c0aab05cc6836a8f5148cca345b92ebc948a4a2013f18d117b7ade6ff05aca6"), }, # We need at least Node 18.17 due to some transitive dependencies. node_version = "18.20.0", ) # Download npm dependencies. load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") load("//integration:npm_package_archives.bzl", "npm_package_archives") yarn_install( name = "npm", # Note that we add the postinstall scripts here so that the dependencies are re-installed # when the postinstall patches are modified. data = [ YARN_LABEL, "//:.yarnrc", "//:tools/npm-patches/@bazel+jasmine+5.8.1.patch", "//tools:postinstall-patches.js", "//tools/esm-interop:patches/npm/@angular+build-tooling+0.0.0-d30a56c19bafaac67cf44e605ed8c2c0e45b0a51.patch", "//tools/esm-interop:patches/npm/@bazel+concatjs+5.8.1.patch", "//tools/esm-interop:patches/npm/@bazel+esbuild+5.7.1.patch", "//tools/esm-interop:patches/npm/@bazel+protractor+5.7.1.patch", "//tools/esm-interop:patches/npm/rxjs+6.6.7.patch", ], # Currently disabled due to: # 1. Missing Windows support currently. # 2. Incompatibilites with the `ts_library` rule. exports_directories_only = False, manual_build_file_contents = npm_package_archives(), package_json = "//:package.json", # We prefer to symlink the `node_modules` to only maintain a single install. # See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details. symlink_node_modules = True, yarn = YARN_LABEL, yarn_lock = "//:yarn.lock", ) load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") aspect_bazel_lib_dependencies() # Load protractor dependencies load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies") npm_bazel_protractor_dependencies() # Setup the rules_webtesting toolchain load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") web_test_repositories() load("@npm//@angular/build-tooling/bazel/browsers:browser_repositories.bzl", "browser_repositories") browser_repositories() load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories") esbuild_repositories( npm_repository = "npm", ) load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") rules_pkg_dependencies() load("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository", "cldr_xml_data_repository") cldr_major_version = "41" cldr_json_data_repository( name = "cldr_json_data", urls = { "https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (cldr_major_version, cldr_major_version): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614", }, )
{ "end_byte": 5920, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/WORKSPACE" }
angular/WORKSPACE_5922_8200
cldr_xml_data_repository( name = "cldr_xml_data", urls = { "https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (cldr_major_version, cldr_major_version): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853", }, ) # sass rules http_archive( name = "io_bazel_rules_sass", sha256 = "450c42cc29976a64172851a7830e97342f231759b7ce79d095bd0db28871867f", strip_prefix = "rules_sass-c67712337794088aeabea63c7111035d4ffec6d4", urls = [ "https://github.com/bazelbuild/rules_sass/archive/c67712337794088aeabea63c7111035d4ffec6d4.zip", ], ) # Setup the rules_sass toolchain load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") sass_repositories( yarn_script = YARN_LABEL, ) # Register git toolchains register_toolchains( "@npm//@angular/build-tooling/bazel/git-toolchain:git_linux_toolchain", "@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_x86_toolchain", "@npm//@angular/build-tooling/bazel/git-toolchain:git_macos_arm64_toolchain", "@npm//@angular/build-tooling/bazel/git-toolchain:git_windows_toolchain", ) # Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests) http_archive( name = "sauce_connect_linux_amd64", build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""", sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36", strip_prefix = "sc-4.8.2-linux", url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz", ) http_archive( name = "sauce_connect_mac", build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""", sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089", strip_prefix = "sc-4.8.2-osx", url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip", ) yarn_install( name = "npm_ts_versions", data = [ YARN_LABEL, "//:.yarnrc", ], exports_directories_only = False, package_json = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:package.json", yarn = YARN_LABEL, yarn_lock = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:yarn.lock", )
{ "end_byte": 8200, "start_byte": 5922, "url": "https://github.com/angular/angular/blob/main/WORKSPACE" }
angular/README.md_0_5367
<h1 align="center">Angular - The modern web developer's platform</h1> <p align="center"> <img src="adev/src/assets/images/press-kit/angular_icon_gradient.gif" alt="angular-logo" width="120px" height="120px"/> <br> <em>Angular is a development platform for building mobile and desktop web applications <br> using TypeScript/JavaScript and other languages.</em> <br> </p> <p align="center"> <a href="https://angular.dev/"><strong>angular.dev</strong></a> <br> </p> <p align="center"> <a href="CONTRIBUTING.md">Contributing Guidelines</a> · <a href="https://github.com/angular/angular/issues">Submit an Issue</a> · <a href="https://blog.angular.dev/">Blog</a> <br> <br> </p> <p align="center"> <a href="https://circleci.com/gh/angular/workflows/angular/tree/main"> <img src="https://img.shields.io/circleci/build/github/angular/angular/main.svg?logo=circleci&logoColor=fff&label=CircleCI" alt="CI status" /> </a>&nbsp; <a href="https://www.npmjs.com/@angular/core"> <img src="https://img.shields.io/npm/v/@angular/core.svg?logo=npm&logoColor=fff&label=NPM+package&color=limegreen" alt="Angular on npm" /> </a>&nbsp; <a href="https://discord.gg/angular"> <img src="https://img.shields.io/discord/463752820026376202.svg?logo=discord&logoColor=fff&label=Discord&color=7389d8" alt="Discord conversation" /> </a> </p> <p align="center"> <a href="https://app.circleci.com/insights/github/angular/angular/workflows/default_workflow?branch=main"> <img src="https://dl.circleci.com/insights-snapshot/gh/angular/angular/main/default_workflow/badge.svg" alt="InsightsSnapshot" /> </a> </p> <hr> ## Documentation Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website. - [Getting Started][quickstart] - [Architecture][architecture] - [Components and Templates][componentstemplates] - [Forms][forms] - [API][api] ### Advanced - [Angular Elements][angularelements] - [Server Side Rendering][ssr] - [Schematics][schematics] - [Lazy Loading][lazyloading] - [Animations][animations] ### Local Development To contribute to the Angular Docs, check out the [Angular.dev README](adev/README.md) ## Development Setup ### Prerequisites - Install [Node.js] which includes [Node Package Manager][npm] ### Setting Up a Project Install the Angular CLI globally: ``` npm install -g @angular/cli ``` Create workspace: ``` ng new [PROJECT NAME] ``` Run the application: ``` cd [PROJECT NAME] ng serve ``` Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions. ## Quickstart [Get started in 5 minutes][quickstart]. ## Ecosystem <p> <img src="/contributing-docs/images/angular-ecosystem-logos.png" alt="angular ecosystem logos" width="500px" height="auto"> </p> - [Angular Command Line (CLI)][cli] - [Angular Material][angularmaterial] ## Changelog [Learn about the latest improvements][changelog]. ## Upgrading Check out our [upgrade guide](https://angular.dev/update-guide/) to find out the best way to upgrade your project. ## Contributing ### Contributing Guidelines Read through our [contributing guidelines][contributing] to learn about our submission process, coding rules, and more. ### Want to Help? Want to report a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for [contributing][contributing] and then check out one of our issues labeled as <kbd>[help wanted](https://github.com/angular/angular/labels/help%20wanted)</kbd> or <kbd>[good first issue](https://github.com/angular/angular/labels/good%20first%20issue)</kbd>. ### Code of Conduct Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][codeofconduct]. ## Community Join the conversation and help the community. - [X (formerly Twitter)][X (formerly Twitter)] - [Discord][discord] - [Gitter][gitter] - [YouTube][youtube] - [StackOverflow][stackoverflow] - Find a Local [Meetup][meetup] [![Love Angular badge](https://img.shields.io/badge/angular-love-blue?logo=angular&angular=love)](https://www.github.com/angular/angular) **Love Angular? Give our repo a star :star: :arrow_up:.** [contributing]: CONTRIBUTING.md [quickstart]: https://angular.dev/tutorials/learn-angular [changelog]: CHANGELOG.md [ng]: https://angular.dev [documentation]: https://angular.dev/overview [angularmaterial]: https://material.angular.io/ [cli]: https://angular.dev/tools/cli [architecture]: https://angular.dev/essentials [componentstemplates]: https://angular.dev/tutorials/learn-angular/1-components-in-angular [forms]: https://angular.dev/tutorials/learn-angular/15-forms [api]: https://angular.dev/api [angularelements]: https://angular.dev/guide/elements [ssr]: https://angular.dev/guide/ssr [schematics]: https://angular.dev/tools/cli/schematics [lazyloading]: https://angular.dev/guide/ngmodules/lazy-loading [node.js]: https://nodejs.org/ [npm]: https://www.npmjs.com/get-npm [codeofconduct]: CODE_OF_CONDUCT.md [X (formerly Twitter)]: https://www.twitter.com/angular [discord]: https://discord.gg/angular [gitter]: https://gitter.im/angular/angular [stackoverflow]: https://stackoverflow.com/questions/tagged/angular [youtube]: https://youtube.com/angular [meetup]: https://www.meetup.com/find/?keywords=angular [animations]: https://angular.dev/guide/animations
{ "end_byte": 5367, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/README.md" }
angular/browser-providers.conf.js_0_2504
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ // Unique place to configure the browsers which are used in the different CI jobs in Sauce Labs (SL) // If the target is set to null, then the browser is not run anywhere during CI. // If a category becomes empty (e.g. BS and required), then the corresponding job must be commented // out in the CI configuration. const config = { 'Android13': {unitTest: {target: 'SL', required: true}}, 'Android14': {unitTest: {target: 'SL', required: true}}, }; /** Whether browsers should be remotely acquired in debug mode. */ const debugMode = false; // Karma-sauce-launcher isn't really maintained and doesn't support officially appium2 // Looking at the source code https://github.com/karma-runner/karma-sauce-launcher/blob/69dcb822a45d29e57297b0eda7af4123ae55aafd/src/process-config.ts#L60 // We can force the config to be recognized as W3C by setting a browserVersion property const browserVersion = 'latest'; // Specific platform configuration can be found at: // https://saucelabs.com/platform/platform-configurator const customLaunchers = { 'SL_ANDROID13': { base: 'SauceLabs', platformName: 'Android', browserName: 'Chrome', browserVersion, 'appium:deviceName': 'Google Pixel 5a GoogleAPI Emulator', 'appium:platformVersion': '13.0', 'appium:automationName': 'uiautomator2', 'sauce:options': { appiumVersion: '2.0.0', extendedDebugging: debugMode, }, }, 'SL_ANDROID14': { base: 'SauceLabs', platformName: 'Android', browserName: 'Chrome', browserVersion, 'appium:deviceName': 'Google Pixel 6 Pro GoogleAPI Emulator', 'appium:platformVersion': '14.0', 'appium:automationName': 'uiautomator2', 'sauce:options': { appiumVersion: '2.0.0', extendedDebugging: debugMode, }, }, }; const sauceAliases = { 'CI_REQUIRED': buildConfiguration('unitTest', 'SL', true), 'CI_OPTIONAL': buildConfiguration('unitTest', 'SL', false), }; module.exports = { customLaunchers: customLaunchers, sauceAliases: sauceAliases, }; function buildConfiguration(type, target, required) { return Object.keys(config) .filter((item) => { const conf = config[item][type]; return conf.required === required && conf.target === target; }) .map((item) => target + '_' + item.toUpperCase()); }
{ "end_byte": 2504, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/browser-providers.conf.js" }
angular/packages.bzl_0_3304
# Copyright Google LLC All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license """Packages published to npm""" def to_package_label(package_name): """Get a label corresponding to the npm_package target for the package name""" if package_name == "angular-in-memory-web-api": return "//packages/misc/angular-in-memory-web-api:npm_package" if package_name == "@angular/docs": return "//adev/shared-docs:npm_package" return "//packages/{package_name}:npm_package".format(package_name = package_name.replace("@angular/", "")) def _exclude_pkgs(packages, *args): modified_packages = packages[:] for pkg in args: modified_packages.remove(pkg) return modified_packages # All framework packages published to NPM. PUBLISHED_PACKAGES = [ "@angular/animations", "@angular/benchpress", "@angular/common", "@angular/compiler", "@angular/compiler-cli", "@angular/core", "@angular/elements", "@angular/forms", "@angular/language-service", "@angular/localize", "@angular/platform-browser", "@angular/platform-browser-dynamic", "@angular/platform-server", "@angular/router", "@angular/service-worker", "@angular/upgrade", "angular-in-memory-web-api", "zone.js", ] # All packages in the repository which are not published to NPM UNPUBLISHED_PACKAGES = [ "@angular/docs", ] ALL_PACKAGES = PUBLISHED_PACKAGES + UNPUBLISHED_PACKAGES # Packages used by integration tests INTEGRATION_PACKAGES = _exclude_pkgs(PUBLISHED_PACKAGES, "angular-in-memory-web-api") # Package names under //packages that have `files_for_docgen` targets DOCS_ENTRYPOINTS = [ "animations", "animations/browser", "animations/browser/testing", "common", "common/http", "common/http/testing", "common/testing", "common/upgrade", "compiler", "core", "core/rxjs-interop", "core/src/compiler", "core/src/di/interface", "core/src/interface", "core/src/reflection", "core/src/util", "core/testing", "elements", "examples/common", "examples/core", "examples/core/di/ts/forward_ref", "examples/core/testing/ts", "examples/forms", "examples/platform-browser", "examples/router/activated-route", "examples/router/testing", "examples/router", "examples/service-worker/push", "examples/service-worker/registration-options", "examples/test-utils", "examples/testing", "examples/upgrade/static/ts/full", "examples/upgrade/static/ts/lite", "examples/upgrade/static/ts/lite-multi", "examples/upgrade/static/ts/lite-multi-shared", "forms", "localize", "localize/init", "localize/src/localize", "localize/src/utils", "platform-browser", "platform-browser-dynamic", "platform-browser-dynamic/testing", "platform-browser/animations", "platform-browser/animations/async", "platform-browser/testing", "platform-server", "platform-server/init", "platform-server/testing", "router", "router/testing", "router/upgrade", "service-worker", "upgrade", "upgrade/src/common", "upgrade/static", "upgrade/static/testing", ]
{ "end_byte": 3304, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/packages.bzl" }
angular/CONTRIBUTING.md_0_8606
# Contributing to Angular We would love for you to contribute to Angular and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow: - [Code of Conduct](#coc) - [Question or Problem?](#question) - [Issues and Bugs](#issue) - [Feature Requests](#feature) - [Submission Guidelines](#submit) - [Coding Rules](#rules) - [Commit Message Guidelines](#commit) - [Signing the CLA](#cla) ## <a name="coc"></a> Code of Conduct Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc]. ## <a name="question"></a> Got a Question or Problem? Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. Instead, we recommend using [Stack Overflow](https://stackoverflow.com/questions/tagged/angular) to ask support-related questions. When creating a new question on Stack Overflow, make sure to add the `angular` tag. Stack Overflow is a much better place to ask questions since: - there are thousands of people willing to help on Stack Overflow - questions and answers stay available for public viewing so your question/answer might help someone else - Stack Overflow's voting system assures that the best answers are prominently visible. To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow. If you would like to chat about the question in real-time, you can reach out via [the Angular community Discord server][discord]. ## <a name="issue"></a> Found a Bug? If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can [submit a Pull Request](#submit-pr) with a fix. ## <a name="feature"></a> Missing a Feature? You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository. If you would like to *implement* a new feature, please consider the size of the change in order to determine the right steps to proceed: * For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. **Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature. * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). ## <a name="submit"></a> Submission Guidelines ### <a name="submit-issue"></a> Submitting an Issue Before you submit an issue, please search the issue tracker. An issue for your problem might already exist and the discussion might inform you of workarounds readily available. We want to fix all the issues as soon as possible, but before fixing a bug, we need to reproduce and confirm it. In order to reproduce bugs, we require that you provide a minimal reproduction. Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions. A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem. We require a minimal reproduction to save maintainers' time and ultimately be able to fix more bugs. Often, developers find coding problems themselves while preparing a minimal reproduction. We understand that sometimes it might be hard to extract essential bits of code from a larger codebase, but we really need to isolate the problem before we can fix it. Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced. You can file new issues by selecting from our [new issue templates](https://github.com/angular/angular/issues/new/choose) and filling out the issue template. ### <a name="submit-pr"></a> Submitting a Pull Request (PR) Before you submit your Pull Request (PR) consider the following guidelines: 1. Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR that relates to your submission. You don't want to duplicate existing efforts. 2. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add. Discussing the design upfront helps to ensure that we're ready to accept your work. 3. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs. We cannot accept code without a signed CLA. Make sure you author all contributed Git commits with email address associated with your CLA signature. 4. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the [angular/angular](https://github.com/angular/angular/fork) repo. 5. In your forked repository, make your changes in a new git branch: ```shell git checkout -b my-fix-branch main ``` 6. Create your patch, **including appropriate test cases**. 7. Follow our [Coding Rules](#rules). 8. Run the full Angular test suite, as described in the [developer documentation][dev-doc], and ensure that all tests pass. 9. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). Adherence to these conventions is necessary because release notes are automatically generated from these messages. ```shell git commit --all ``` Note: the optional commit `--all` command line option will automatically "add" and "rm" edited files. 10. Push your branch to GitHub: ```shell git push origin my-fix-branch ``` 11. In GitHub, send a pull request to `angular:main`. ### Reviewing a Pull Request The Angular team reserves the right not to accept pull requests from community members who haven't been good citizens of the community. Such behavior includes not following the [Angular code of conduct](https://github.com/angular/code-of-conduct) and applies within or outside of Angular managed channels. #### Addressing review feedback If we ask for changes via code reviews then: 1. Make the required updates to the code. 2. Re-run the Angular test suites to ensure tests are still passing. 3. Create a fixup commit and push to your GitHub repository (this will update your Pull Request): ```shell git commit --all --fixup HEAD git push ``` For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md). That's it! Thank you for your contribution! ##### Updating the commit message A reviewer might often suggest changes to a commit message (for example, to add more context for a change or adhere to our [commit message guidelines](#commit)). In order to update the commit message of the last commit on your branch: 1. Check out your branch: ```shell git checkout my-fix-branch ``` 2. Amend the last commit and modify the commit message: ```shell git commit --amend ``` 3. Push to your GitHub repository: ```shell git push --force-with-lease ``` > NOTE:<br /> > If you need to update the commit message of an earlier commit, you can use `git rebase` in interactive mode. > See the [git docs](https://git-scm.com/docs/git-rebase#_interactive_mode) for more details. #### After your pull request is merged After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository: * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: ```shell git push origin --delete my-fix-branch ``` * Check out the main branch: ```shell git checkout main -f ``` * Delete the local branch: ```shell git branch -D my-fix-branch ``` * Update your local `main` with the latest upstream version: ```shell git pull --ff upstream main ``` ## <a name="rules"></a> Coding Rules To ensure consistency throughout the source code, keep these rules in mind as you are working: * All features or bug fixes **must be tested** by one or more specs (unit-tests). * All public API methods **must be documented**. * We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at **100 characters**. An automated formatter is available, see [DEVELOPER.md](contributing-docs/building-and-testing-angular.md#formatting-your-source-code).
{ "end_byte": 8606, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/CONTRIBUTING.md" }
angular/CONTRIBUTING.md_8606_15993
## <a name="commit"></a> Commit Message Format *This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].* We have very precise rules over how our Git commit messages must be formatted. This format leads to **easier to read commit history**. Each commit message consists of a **header**, a **body**, and a **footer**. ``` <header> <BLANK LINE> <body> <BLANK LINE> <footer> ``` The `header` is mandatory and must conform to the [Commit Message Header](#commit-header) format. The `body` is mandatory for all commits except for those of type "docs". When the body is present it must be at least 20 characters long and must conform to the [Commit Message Body](#commit-body) format. The `footer` is optional. The [Commit Message Footer](#commit-footer) format describes what the footer is used for and the structure it must have. #### <a name="commit-header"></a>Commit Message Header ``` <type>(<scope>): <short summary> │ │ │ │ │ └─⫸ Summary in present tense. Not capitalized. No period at the end. │ │ │ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core| │ elements|forms|http|language-service|localize|platform-browser| │ platform-browser-dynamic|platform-server|router|service-worker| │ upgrade|zone.js|packaging|changelog|docs-infra|migrations| │ devtools │ └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test ``` The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional. ##### Type Must be one of the following: * **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) * **ci**: Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs) * **docs**: Documentation only changes * **feat**: A new feature * **fix**: A bug fix * **perf**: A code change that improves performance * **refactor**: A code change that neither fixes a bug nor adds a feature * **test**: Adding missing tests or correcting existing tests ##### Scope The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages). The following is the list of supported scopes: * `animations` * `bazel` * `benchpress` * `common` * `compiler` * `compiler-cli` * `core` * `elements` * `forms` * `http` * `language-service` * `localize` * `platform-browser` * `platform-browser-dynamic` * `platform-server` * `router` * `service-worker` * `upgrade` * `zone.js` There are currently a few exceptions to the "use package name" rule: * `packaging`: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc. * `changelog`: used for updating the release notes in CHANGELOG.md * `dev-infra`: used for dev-infra related changes within the directories /scripts and /tools * `docs-infra`: used for docs-app (angular.dev) related changes within the /adev directory of the repo * `migrations`: used for changes to the `ng update` migrations. * `devtools`: used for changes in the [browser extension](./devtools/README.md). * none/empty string: useful for `test` and `refactor` changes that are done across all packages (e.g. `test: add missing unit tests`) and for docs changes that are not related to a specific package (e.g. `docs: fix typo in tutorial`). ##### Summary Use the summary field to provide a succinct description of the change: * use the imperative, present tense: "change" not "changed" nor "changes" * don't capitalize the first letter * no dot (.) at the end #### <a name="commit-body"></a>Commit Message Body Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes". Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making the change. You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change. #### <a name="commit-footer"></a>Commit Message Footer The footer can contain information about breaking changes and deprecations and is also the place to reference GitHub issues, Jira tickets, and other PRs that this commit closes or is related to. For example: ``` BREAKING CHANGE: <breaking change summary> <BLANK LINE> <breaking change description + migration instructions> <BLANK LINE> <BLANK LINE> Fixes #<issue number> ``` or ``` DEPRECATED: <what is deprecated> <BLANK LINE> <deprecation description + recommended update path> <BLANK LINE> <BLANK LINE> Closes #<pr number> ``` Breaking Change section should start with the phrase `BREAKING CHANGE: ` followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions. Similarly, a Deprecation section should start with `DEPRECATED: ` followed by a short description of what is deprecated, a blank line, and a detailed description of the deprecation that also mentions the recommended update path. ### Revert commits If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. The content of the commit message body should contain: - information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`, - a clear description of the reason for reverting the commit message. ## <a name="cla"></a> Signing the CLA Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code changes to be accepted, the CLA must be signed. It's a quick process, we promise! * For individuals, we have a [simple click-through form][individual-cla]. * For corporations, we'll need you to [print, sign and one of scan+email, fax or mail the form][corporate-cla]. If you have more than one GitHub accounts, or multiple email addresses associated with a single GitHub account, you must sign the CLA using the primary email address of the GitHub account used to author Git commits and send pull requests. The following documents can help you sort out issues with GitHub accounts and multiple email addresses: * https://help.github.com/articles/setting-your-commit-email-address-in-git/ * https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean * https://help.github.com/articles/about-commit-email-addresses/ * https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/ [coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md [commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# [corporate-cla]: https://cla.developers.google.com/about/google-corporate [dev-doc]: ./contributing-docs/building-and-testing-angular.md [github]: https://github.com/angular/angular [discord]: https://discord.gg/angular [individual-cla]: https://cla.developers.google.com/about/google-individual [js-style-guide]: https://google.github.io/styleguide/jsguide.html
{ "end_byte": 15993, "start_byte": 8606, "url": "https://github.com/angular/angular/blob/main/CONTRIBUTING.md" }
angular/gulpfile.js_0_572
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ 'use strict'; const gulp = require('gulp'); // See `tools/gulp-tasks/README.md` for information about task loading. function loadTask(fileName, taskName) { const taskModule = require('./tools/gulp-tasks/' + fileName); const task = taskName ? taskModule[taskName] : taskModule; return task(gulp); } gulp.task('changelog:zonejs', loadTask('changelog-zonejs'));
{ "end_byte": 572, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/gulpfile.js" }
angular/BUILD.bazel_0_2589
load("//tools:defaults.bzl", "nodejs_binary") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") load("//:yarn.bzl", "YARN_PATH") package(default_visibility = ["//visibility:public"]) exports_files([ "LICENSE", "karma-js.conf.js", "browser-providers.conf.js", YARN_PATH, "scripts/ci/bazel-payload-size.sh", "scripts/ci/payload-size.sh", "scripts/ci/payload-size.js", "package.json", "angular.json", ]) filegroup( # filegroup is needed so that this package.json file can be a dep # in a js_library target, which doesn't allow source file deps name = "package_json", srcs = ["package.json"], ) alias( name = "tsconfig.json", actual = "//packages:tsconfig-build.json", ) js_library( name = "browser-providers", srcs = [ "browser-providers.conf.d.ts", "browser-providers.conf.js", ], ) filegroup( name = "angularjs_scripts", srcs = [ # We also declare the unminified AngularJS files since these can be used for # local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts) "@npm//:node_modules/angular-1.5/angular.js", "@npm//:node_modules/angular-1.5/angular.min.js", "@npm//:node_modules/angular-1.6/angular.js", "@npm//:node_modules/angular-1.6/angular.min.js", "@npm//:node_modules/angular-1.7/angular.js", "@npm//:node_modules/angular-1.7/angular.min.js", "@npm//:node_modules/angular-mocks-1.5/angular-mocks.js", "@npm//:node_modules/angular-mocks-1.6/angular-mocks.js", "@npm//:node_modules/angular-mocks-1.7/angular-mocks.js", "@npm//:node_modules/angular-mocks-1.8/angular-mocks.js", "@npm//:node_modules/angular-1.8/angular.js", "@npm//:node_modules/angular-1.8/angular.min.js", ], ) # Detect if the build is running under --stamp config_setting( name = "stamp", values = {"stamp": "true"}, ) nodejs_binary( name = "yarn_vendored", data = [".yarn/releases/yarn-1.22.19.cjs"], entry_point = ".yarn/releases/yarn-1.22.19.cjs", visibility = [ "//integration:__subpackages__", "//modules/ssr-benchmarks:__subpackages__", ], ) alias( name = "sauce_connect", actual = select({ "@npm//@angular/build-tooling/bazel/constraints:linux_x64": "@sauce_connect_linux_amd64//:bin/sc", "@npm//@angular/build-tooling/bazel/constraints:macos_x64": "@sauce_connect_mac//:bin/sc", "@npm//@angular/build-tooling/bazel/constraints:macos_arm64": "@sauce_connect_mac//:bin/sc", }), )
{ "end_byte": 2589, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/BUILD.bazel" }
angular/yarn.bzl_0_77
YARN_PATH = ".yarn/releases/yarn-1.22.19.cjs" YARN_LABEL = "//:" + YARN_PATH
{ "end_byte": 77, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/yarn.bzl" }
angular/SECURITY.md_0_413
Angular is part of Google [Open Source Software Vulnerability Reward Program](https://bughunters.google.com/about/rules/6521337925468160/google-open-source-software-vulnerability-reward-program-rules). For vulnerabilities in Angular, please submit your report [here](https://bughunters.google.com/report). For more information, check out [Angular's security policy](https://angular.dev/best-practices/security).
{ "end_byte": 413, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/SECURITY.md" }
angular/tools/ng_benchmark.bzl_0_1060
# Copyright Google LLC All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license """Bazel macro for running Angular benchmarks""" load("//tools:defaults.bzl", "nodejs_binary") def ng_benchmark(name, bundle): """ This macro creates two targets, one that is runnable and prints results and one that can be used for profiling via chrome://inspect. Args: name: name of the runnable rule to create bundle: label of the bundle rule to run """ nodejs_binary( name = name, data = [bundle], entry_point = bundle + ".debug.min.js", tags = ["local", "manual"], # run benchmarks locally and never on CI ) nodejs_binary( name = name + "_profile", data = [bundle], entry_point = bundle + ".debug.min.js", args = ["--node_options=--no-turbo-inlining --node_options=--inspect-brk"], tags = ["local", "manual"], # run benchmarks locally and never on CI )
{ "end_byte": 1060, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/ng_benchmark.bzl" }
angular/tools/types.d.ts_0_386
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ // This file contains all ambient imports needed to compile the tools source code /// <reference types="jasmine" /> /// <reference types="node" /> /// <reference types="zone.js" />
{ "end_byte": 386, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/types.d.ts" }
angular/tools/BUILD.bazel_0_765
load("//tools:defaults.bzl", "ts_config") package(default_visibility = ["//visibility:public"]) exports_files([ "tsconfig.json", "postinstall-patches.js", ]) ts_config( name = "tsconfig-test", src = "tsconfig-test.json", deps = ["tsconfig.json"], ) platform( name = "rbe_ubuntu1604-angular", parents = ["@rbe_ubuntu1604_angular//config:platform"], remote_execution_properties = """ {PARENT_REMOTE_EXECUTION_PROPERTIES} properties: { name: "dockerAddCapabilities" value: "SYS_ADMIN" } properties: { name: "dockerNetwork" value: "standard" } properties: { name: "Pool" value: "default" } """, )
{ "end_byte": 765, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/BUILD.bazel" }
angular/tools/postinstall-patches.js_0_2988
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ try { require.resolve('shelljs'); } catch (e) { // We are in an bazel managed external node_modules repository // and the resolve has failed because node did not preserve the symlink // when loading the script. // This can be fixed using the --preserve-symlinks-main flag which // is introduced in node 10.2.0 console.warn( `Running postinstall-patches.js script in an external repository requires --preserve-symlinks-main node flag introduced in node 10.2.0. ` + `Current node version is ${process.version}. Node called with '${process.argv.join(' ')}'.`, ); process.exit(0); } const {set, cd, sed, echo, ls, rm} = require('shelljs'); const {readFileSync, writeFileSync} = require('fs'); const path = require('path'); const log = console.info; // COMMENTED OUT BECAUSE WE CURRENTLY REQUIRE NO PATCHES // UNCOMMENT TO REENABLE PATCHING AND LOG OUTPUT // log('===== about to run the postinstall-patches.js script ====='); // fail on first error set('-e'); // print commands as being executed set('-v'); // jump to project root cd(path.join(__dirname, '../')); /* EXAMPLE PATCH: // https://github.com/ReactiveX/rxjs/pull/3302 // make node_modules/rxjs compilable with Typescript 2.7 // remove when we update to rxjs v6 log('\n# patch: reactivex/rxjs#3302 make node_modules/rxjs compilable with Typescript 2.7'); sed('-i', '(\'response\' in xhr)', '(\'response\' in (xhr as any))', 'node_modules/rxjs/src/observable/dom/AjaxObservable.ts'); */ log('\n# patch: delete d.ts files referring to rxjs-compat'); // more info in https://github.com/angular/angular/pull/33786 rm('-rf', [ 'node_modules/rxjs/add/', 'node_modules/rxjs/observable/', 'node_modules/rxjs/operator/', // rxjs/operators is a public entry point that also contains files to support legacy deep import // paths, so we need to preserve index.* and package.json files that are required for module // resolution. 'node_modules/rxjs/operators/!(index.*|package.json)', 'node_modules/rxjs/scheduler/', 'node_modules/rxjs/symbol/', 'node_modules/rxjs/util/', 'node_modules/rxjs/internal/Rx.d.ts', 'node_modules/rxjs/AsyncSubject.*', 'node_modules/rxjs/BehaviorSubject.*', 'node_modules/rxjs/InnerSubscriber.*', 'node_modules/rxjs/interfaces.*', 'node_modules/rxjs/Notification.*', 'node_modules/rxjs/Observable.*', 'node_modules/rxjs/Observer.*', 'node_modules/rxjs/Operator.*', 'node_modules/rxjs/OuterSubscriber.*', 'node_modules/rxjs/ReplaySubject.*', 'node_modules/rxjs/Rx.*', 'node_modules/rxjs/Scheduler.*', 'node_modules/rxjs/Subject.*', 'node_modules/rxjs/SubjectSubscription.*', 'node_modules/rxjs/Subscriber.*', 'node_modules/rxjs/Subscription.*', ]); log('===== finished running the postinstall-patches.js script =====');
{ "end_byte": 2988, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/postinstall-patches.js" }
angular/tools/defaults.bzl_0_7352
"""Re-export of some bazel rules with repository-wide defaults.""" load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test", _npm_package_bin = "npm_package_bin", _pkg_npm = "pkg_npm") load("@npm//@bazel/jasmine:index.bzl", _jasmine_node_test = "jasmine_node_test") load("@npm//@bazel/concatjs:index.bzl", _ts_config = "ts_config", _ts_library = "ts_library") load("@npm//@bazel/rollup:index.bzl", _rollup_bundle = "rollup_bundle") load("@npm//@bazel/terser:index.bzl", "terser_minified") load("@npm//@bazel/protractor:index.bzl", _protractor_web_test_suite = "protractor_web_test_suite") load("@npm//typescript:index.bzl", "tsc") load("@npm//@angular/build-tooling/bazel/app-bundling:index.bzl", _app_bundle = "app_bundle") load("@npm//@angular/build-tooling/bazel/http-server:index.bzl", _http_server = "http_server") load("@npm//@angular/build-tooling/bazel/karma:index.bzl", _karma_web_test = "karma_web_test", _karma_web_test_suite = "karma_web_test_suite") load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", _api_golden_test = "api_golden_test", _api_golden_test_npm_package = "api_golden_test_npm_package") load("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl", "extract_js_module_output") load("@npm//@angular/build-tooling/bazel:extract_types.bzl", _extract_types = "extract_types") load("@npm//@angular/build-tooling/bazel/esbuild:index.bzl", _esbuild = "esbuild", _esbuild_config = "esbuild_config", _esbuild_esm_bundle = "esbuild_esm_bundle") load("@npm//@angular/build-tooling/bazel/spec-bundling:spec-entrypoint.bzl", "spec_entrypoint") load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle") load("@npm//tsec:index.bzl", _tsec_test = "tsec_test") load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package") load("//tools/esm-interop:index.bzl", "enable_esm_node_module_loader", _nodejs_binary = "nodejs_binary", _nodejs_test = "nodejs_test") load("//adev/shared-docs/pipeline/api-gen:generate_api_docs.bzl", _generate_api_docs = "generate_api_docs") _DEFAULT_TSCONFIG_TEST = "//packages:tsconfig-test" _INTERNAL_NG_MODULE_COMPILER = "//packages/bazel/src/ngc-wrapped" _INTERNAL_NG_MODULE_XI18N = "//packages/bazel/src/ngc-wrapped:xi18n" _INTERNAL_NG_PACKAGE_PACKAGER = "//packages/bazel/src/ng_package:packager" _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP_CONFIG_TMPL = "//packages/bazel/src/ng_package:rollup.config.js" _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP = "//packages/bazel/src/ng_package/rollup" esbuild_config = _esbuild_config esbuild_esm_bundle = _esbuild_esm_bundle http_server = _http_server extract_types = _extract_types # Packages which are versioned together on npm ANGULAR_SCOPED_PACKAGES = ["@angular/%s" % p for p in [ # core should be the first package because it's the main package in the group # this is significant for Angular CLI and "ng update" specifically, @angular/core # is considered the identifier of the group by these tools. "core", "bazel", "common", "compiler", "compiler-cli", "animations", "elements", "platform-browser", "platform-browser-dynamic", "forms", # Current plan for Angular v8 is to not include @angular/http in ng update # "http", "platform-server", "upgrade", "router", "language-service", "localize", "service-worker", ]] PKG_GROUP_REPLACEMENTS = { "\"NG_UPDATE_PACKAGE_GROUP\"": """[ %s ]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_SCOPED_PACKAGES]), } def _default_module_name(testonly): """ Provide better defaults for package names. e.g. rather than angular/packages/core/testing we want @angular/core/testing TODO(alexeagle): we ought to supply a default module name for every library in the repo. But we short-circuit below in cases that are currently not working. """ pkg = native.package_name() if testonly: # Some tests currently rely on the long-form package names return None if pkg.startswith("packages/bazel"): # Avoid infinite recursion in the ViewEngine compiler. Error looks like: # Compiling Angular templates (ngc) //packages/bazel/test/ngc-wrapped/empty:empty failed (Exit 1) # : RangeError: Maximum call stack size exceeded # at normalizeString (path.js:57:25) # at Object.normalize (path.js:1132:12) # at Object.join (path.js:1167:18) # at resolveModule (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:582:50) # at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:119:42) # at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:121:52) return None if pkg.startswith("packages/"): return "@angular/" + pkg[len("packages/"):] return None ts_config = _ts_config def ts_library( name, tsconfig = None, testonly = False, deps = [], module_name = None, package_name = None, devmode_target = "es2022", prodmode_target = "es2022", **kwargs): """Default values for ts_library""" deps = deps + ["@npm//tslib"] if testonly: # Match the types[] in //packages:tsconfig-test.json deps.append("@npm//@types/jasmine") deps.append("@npm//@types/node") if not tsconfig and testonly: tsconfig = _DEFAULT_TSCONFIG_TEST if not module_name: module_name = _default_module_name(testonly) # If no `package_name` is explicitly set, we use the default module name as package # name, so that the target can be resolved within NodeJS executions, by activating # the Bazel NodeJS linker. See: https://github.com/bazelbuild/rules_nodejs/pull/2799. if not package_name: package_name = _default_module_name(testonly) default_module = "esnext" _ts_library( name = name, tsconfig = tsconfig, testonly = testonly, deps = deps, devmode_target = devmode_target, devmode_module = default_module, # For prodmode, the target is set to `ES2022`. `@bazel/typecript` sets `ES2015` by # default. Note that this should be in sync with the `ng_module` tsconfig generation. # https://github.com/bazelbuild/rules_nodejs/blob/901df3868e3ceda177d3ed181205e8456a5592ea/third_party/github.com/bazelbuild/rules_typescript/internal/common/tsconfig.bzl#L195 # https://github.com/bazelbuild/rules_nodejs/blob/9b36274dba34204625579463e3da054a9f42cb47/packages/typescript/internal/build_defs.bzl#L85. prodmode_target = prodmode_target, prodmode_module = default_module, # `module_name` is used for AMD module names within emitted JavaScript files. module_name = module_name, # `package_name` can be set to allow for the Bazel NodeJS linker to run. This # allows for resolution of the given target within the `node_modules/`. package_name = package_name, **kwargs )
{ "end_byte": 7352, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/defaults.bzl" }
angular/tools/defaults.bzl_7354_15921
def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps = [], module_name = None, package_name = None, **kwargs): """Default values for ng_module""" deps = deps + ["@npm//tslib"] if testonly: # Match the types[] in //packages:tsconfig-test.json deps.append("@npm//@types/jasmine") deps.append("@npm//@types/node") if not tsconfig and testonly: tsconfig = _DEFAULT_TSCONFIG_TEST if not module_name: module_name = _default_module_name(testonly) # If no `package_name` is explicitly set, we use the default module name as package # name, so that the target can be resolved within NodeJS executions, by activating # the Bazel NodeJS linker. See: https://github.com/bazelbuild/rules_nodejs/pull/2799. if not package_name: package_name = _default_module_name(testonly) if not entry_point: entry_point = "public_api.ts" _ng_module( name = name, flat_module_out_file = name, tsconfig = tsconfig, entry_point = entry_point, testonly = testonly, deps = deps, compiler = _INTERNAL_NG_MODULE_COMPILER, ng_xi18n = _INTERNAL_NG_MODULE_XI18N, # `module_name` is used for AMD module names within emitted JavaScript files. module_name = module_name, # `package_name` can be set to allow for the Bazel NodeJS linker to run. This # allows for resolution of the given target within the `node_modules/`. package_name = package_name, perf_flag = "//packages/compiler-cli:ng_perf", **kwargs ) def ng_package(name, readme_md = None, license_banner = None, license = None, deps = [], **kwargs): """Default values for ng_package""" if not readme_md: readme_md = "//packages:README.md" if not license_banner: license_banner = "//packages:license-banner.txt" if not license: license = "//:LICENSE" visibility = kwargs.pop("visibility", None) common_substitutions = dict(kwargs.pop("substitutions", {}), **PKG_GROUP_REPLACEMENTS) substitutions = dict(common_substitutions, **{ "0.0.0-PLACEHOLDER": "0.0.0", }) stamped_substitutions = dict(common_substitutions, **{ "0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}", }) _ng_package( name = name, deps = deps, validate = True, readme_md = readme_md, license = license, license_banner = license_banner, substitutions = select({ "//:stamp": stamped_substitutions, "//conditions:default": substitutions, }), ng_packager = _INTERNAL_NG_PACKAGE_PACKAGER, rollup_config_tmpl = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP_CONFIG_TMPL, rollup = _INTERNAL_NG_PACKAGE_DEFAULT_ROLLUP, visibility = visibility, **kwargs ) pkg_tar( name = name + "_archive", srcs = [":%s" % name], extension = "tar.gz", strip_prefix = "./%s" % name, # should not be built unless it is a dependency of another rule tags = ["manual"], visibility = visibility, ) def pkg_npm(name, deps = [], validate = True, **kwargs): """Default values for pkg_npm""" visibility = kwargs.pop("visibility", None) common_substitutions = dict(kwargs.pop("substitutions", {}), **PKG_GROUP_REPLACEMENTS) substitutions = dict(common_substitutions, **{ "0.0.0-PLACEHOLDER": "0.0.0", }) stamped_substitutions = dict(common_substitutions, **{ "0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}", }) # NOTE: We keep this to avoid the linker mappings from `deps` to be forwarded. # e.g. the `pkg_npm` might have a `package_name` but the source `ts_library` too. # This is a bug in `rules_nodejs` that should be fixed. # TODO(devversion): Remove this when we landed a fix in `rules_nodejs`. # Related to: https://github.com/bazelbuild/rules_nodejs/issues/2941. extract_js_module_output( name = "%s_js_module_output" % name, provider = "JSModuleInfo", include_declarations = True, include_default_files = True, forward_linker_mappings = False, include_external_npm_packages = False, deps = deps, ) _pkg_npm( name = name, validate = validate, substitutions = select({ "//:stamp": stamped_substitutions, "//conditions:default": substitutions, }), deps = [":%s_js_module_output" % name], visibility = visibility, **kwargs ) pkg_tar( name = name + "_archive", srcs = [":%s" % name], extension = "tar.gz", strip_prefix = "./%s" % name, # should not be built unless it is a dependency of another rule tags = ["manual"], visibility = visibility, ) def karma_web_test_suite( name, external = [], browsers = [ "@npm//@angular/build-tooling/bazel/browsers/chromium:chromium", "@npm//@angular/build-tooling/bazel/browsers/firefox:firefox", ], **kwargs): """Default values for karma_web_test_suite""" # Default value for bootstrap bootstrap = kwargs.pop("bootstrap", []) + [ "//tools/testing:browser", ] # Add common deps deps = kwargs.pop("deps", []) data = kwargs.pop("data", []) tags = kwargs.pop("tags", []) spec_bundle( name = "%s_bundle" % name, # Specs from this attribute are filtered and will be executed. We # add bootstrap here for discovery of the module mappings aspect. deps = deps + bootstrap, bootstrap = bootstrap, workspace_name = "angular", external = external, platform = "browser", ) _karma_web_test_suite( name = name, deps = [":%s_bundle" % name], browsers = browsers, data = data, tags = tags, **kwargs ) # Add a saucelabs target for Karma tests in `//packages/`. if native.package_name().startswith("packages/"): _karma_web_test( name = "{}_saucelabs".format(name), # Default timeout is moderate (5min). This causes the test to be terminated while # Saucelabs browsers keep running. Ultimately resulting in failing tests and browsers # unnecessarily being acquired. Our specified Saucelabs idle timeout is 10min, so we use # Bazel's long timeout (15min). This ensures that Karma can shut down properly. timeout = "long", config_file = "//:karma-js.conf.js", deps = [ ":%s_bundle" % name, ], data = data + [ "//:browser-providers.conf.js", "//tools/saucelabs-daemon/launcher:launcher_cjs", ], tags = tags + [ "manual", "no-remote-exec", # Requires network to be able to access saucelabs daemon "requires-network", # Prevent the sandbox from being used so that it can communicate with the saucelabs daemon "no-sandbox", "saucelabs", ], configuration_env_vars = ["KARMA_WEB_TEST_MODE"], **kwargs ) def protractor_web_test_suite( name, deps = [], external = [], browsers = ["@npm//@angular/build-tooling/bazel/browsers/chromium:chromium"], **kwargs): """Default values for protractor_web_test_suite""" spec_bundle( name = "%s_bundle" % name, deps = deps, platform = "cjs-legacy", external = external + ["protractor"], ) _protractor_web_test_suite( name = name, deps = [":%s_bundle" % name], browsers = browsers, **kwargs ) def nodejs_binary( name, templated_args = [], enable_linker = False, **kwargs): npm_workspace = _node_modules_workspace_name() if not enable_linker: templated_args = templated_args + [ # Disable the linker and rely on patched resolution which works better on Windows # and is less prone to race conditions when targets build concurrently. "--nobazel_run_linker", ] _nodejs_binary( name = name, npm_workspace = npm_workspace, linker_enabled = enable_linker, templated_args = templated_args, **kwargs )
{ "end_byte": 15921, "start_byte": 7354, "url": "https://github.com/angular/angular/blob/main/tools/defaults.bzl" }
angular/tools/defaults.bzl_15923_20387
def nodejs_test(name, templated_args = [], enable_linker = False, **kwargs): npm_workspace = _node_modules_workspace_name() if not enable_linker: templated_args = templated_args + [ # Disable the linker and rely on patched resolution which works better on Windows # and is less prone to race conditions when targets build concurrently. "--nobazel_run_linker", ] _nodejs_test( name = name, templated_args = templated_args, linker_enabled = enable_linker, npm_workspace = npm_workspace, **kwargs ) def _node_modules_workspace_name(): return "npm" def npm_package_bin(args = [], **kwargs): _npm_package_bin( # Disable the linker and rely on patched resolution which works better on Windows # and is less prone to race conditions when targets build concurrently. args = ["--nobazel_run_linker"] + args, **kwargs ) # TODO(devversion): Jasmine Node tests are only bundled using `spec_bundle` # because `async/await` syntax needs to be downleveled for ZoneJS. In the # future this can be removed when ZoneJS can work with native async/await in NodeJS. def zone_compatible_jasmine_node_test(name, external = [], srcs = [], deps = [], bootstrap = [], **kwargs): spec_bundle( name = "%s_bundle" % name, # Specs from this attribute are filtered and will be executed. We # add bootstrap here for discovery of the module mappings aspect. deps = srcs + deps + bootstrap, bootstrap = bootstrap, external = external + ["domino", "typescript"], platform = "node", ) jasmine_node_test( name = name, deps = [":%s_bundle" % name], **kwargs ) def esbuild_jasmine_node_test(name, specs = [], external = [], bootstrap = [], **kwargs): templated_args = kwargs.pop("templated_args", []) + [ # TODO: Disable the linker fully here. Currently it is needed for ESM. "--bazel_patch_module_resolver", ] deps = kwargs.pop("deps", []) + [ "@npm//chokidar", "@npm//domino", "@npm//jasmine-core", "@npm//reflect-metadata", "@npm//source-map-support", "@npm//tslib", "@npm//xhr2", ] spec_bundle( name = "%s_test_bundle" % name, platform = "node", target = "es2020", bootstrap = bootstrap, deps = specs + deps, external = external, ) _jasmine_node_test( name = name, srcs = [":%s_test_bundle" % name], use_direct_specs = True, templated_args = templated_args, deps = deps, **kwargs ) def jasmine_node_test(name, srcs = [], data = [], bootstrap = [], env = {}, **kwargs): # Very common dependencies for tests deps = kwargs.pop("deps", []) + [ "@npm//chokidar", "@npm//domino", "@npm//jasmine-core", "@npm//reflect-metadata", "@npm//source-map-support", "@npm//tslib", "@npm//xhr2", ] configuration_env_vars = kwargs.pop("configuration_env_vars", []) # Disable the linker and rely on patched resolution which works better on Windows # and is less prone to race conditions when targets build concurrently. templated_args = ["--nobazel_run_linker"] + kwargs.pop("templated_args", []) # We disable the linker, so the ESM node module loader needs to be enabled. npm_workspace = _node_modules_workspace_name() env = enable_esm_node_module_loader(npm_workspace, env) spec_entrypoint( name = "%s_spec_entrypoint.spec" % name, testonly = True, deps = deps + srcs, bootstrap = bootstrap, ) _jasmine_node_test( name = name, srcs = [":%s_spec_entrypoint.spec" % name], # Note: `deps`, `srcs` and `bootstrap` are explicitly added here as otherwise their linker # mappings may not be discovered, given the `bootstrap` attr not being covered by the aspect. data = data + deps + srcs + bootstrap, use_direct_specs = True, configuration_env_vars = configuration_env_vars, env = env, templated_args = templated_args, use_esm = True, **kwargs ) def app_bundle(**kwargs): """Default values for app_bundle""" _app_bundle(**kwargs) # TODO: Consider removing this rule in favor of `esbuild` for more consistent bundling.
{ "end_byte": 20387, "start_byte": 15923, "url": "https://github.com/angular/angular/blob/main/tools/defaults.bzl" }
angular/tools/defaults.bzl_20388_27940
def rollup_bundle(name, testonly = False, sourcemap = "true", **kwargs): """A drop in replacement for the rules nodejs [legacy rollup_bundle]. Runs [rollup_bundle], [terser_minified] and [babel] for downleveling to es5 to produce a number of output bundles. es2015 iife : "%{name}.es2015.js" es2015 iife minified : "%{name}.min.es2015.js" es2015 iife minified (debug) : "%{name}.min_debug.es2015.js" esm : "%{name}.esm.js" esm : "%{name}.min.esm.js" es5 iife : "%{name}.js" es5 iife minified : "%{name}.min.js" es5 iife minified (debug) : "%{name}.min_debug.js" es5 umd : "%{name}.es5umd.js" es5 umd minified : "%{name}.min.es5umd.js" es2015 umd : "%{name}.umd.js" es2015 umd minified : "%{name}.min.umd.js" ".js.map" files are also produced for each bundle. [legacy rollup_bundle]: https://github.com/bazelbuild/rules_nodejs/blob/0.38.3/internal/rollup/rollup_bundle.bzl [rollup_bundle]: https://bazelbuild.github.io/rules_nodejs/Rollup.html [terser_minified]: https://bazelbuild.github.io/rules_nodejs/Terser.html [babel]: https://babeljs.io/ """ # Common arguments for all terser_minified targets common_terser_args = { "args": ["--comments"], "sourcemap": False, } # esm _rollup_bundle(name = name + ".esm", testonly = testonly, format = "esm", sourcemap = sourcemap, **kwargs) terser_minified(name = name + ".min.esm", testonly = testonly, src = name + ".esm", **common_terser_args) native.filegroup(name = name + ".min.esm.js", testonly = testonly, srcs = [name + ".min.esm"]) # es2015 _rollup_bundle(name = name + ".es2015", testonly = testonly, format = "iife", sourcemap = sourcemap, **kwargs) terser_minified(name = name + ".min.es2015", testonly = testonly, src = name + ".es2015", **common_terser_args) native.filegroup(name = name + ".min.es2015.js", testonly = testonly, srcs = [name + ".min.es2015"]) terser_minified(name = name + ".min_debug.es2015", testonly = testonly, src = name + ".es2015", **common_terser_args) native.filegroup(name = name + ".min_debug.es2015.js", testonly = testonly, srcs = [name + ".min_debug.es2015"]) # es5 tsc( name = name, testonly = testonly, outs = [ name + ".js", ], args = [ "$(execpath :%s.es2015.js)" % name, "--types", "--skipLibCheck", "--target", "es5", "--lib", "es2015,dom", "--allowJS", "--outFile", "$(execpath :%s.js)" % name, ], data = [ name + ".es2015.js", ], ) terser_minified(name = name + ".min", testonly = testonly, src = name + "", **common_terser_args) native.filegroup(name = name + ".min.js", testonly = testonly, srcs = [name + ".min"]) terser_minified(name = name + ".min_debug", testonly = testonly, src = name + "", debug = True, **common_terser_args) native.filegroup(name = name + ".min_debug.js", testonly = testonly, srcs = [name + ".min_debug"]) # umd _rollup_bundle(name = name + ".umd", testonly = testonly, format = "umd", sourcemap = sourcemap, **kwargs) terser_minified(name = name + ".min.umd", testonly = testonly, src = name + ".umd", **common_terser_args) native.filegroup(name = name + ".min.umd.js", testonly = testonly, srcs = [name + ".min.umd"]) tsc( name = name + ".es5umd", testonly = testonly, outs = [ name + ".es5umd.js", ], args = [ "$(execpath :%s.umd.js)" % name, "--types", "--skipLibCheck", "--target", "es5", "--lib", "es2015,dom", "--allowJS", "--outFile", "$(execpath :%s.es5umd.js)" % name, ], data = [ name + ".umd.js", ], ) terser_minified(name = name + ".min.es5umd", testonly = testonly, src = name + ".es5umd", **common_terser_args) native.filegroup(name = name + ".min.es5umd.js", testonly = testonly, srcs = [name + ".min.es5umd"]) def api_golden_test(**kwargs): _api_golden_test( **kwargs ) def api_golden_test_npm_package(**kwargs): _api_golden_test_npm_package( **kwargs ) def tsec_test(**kwargs): """Default values for tsec_test""" _tsec_test( use_runfiles_on_windows = True, # We explicitly enable runfiles in .bazelrc **kwargs ) def esbuild(args = None, **kwargs): _esbuild( args = args if args else { "resolveExtensions": [".mjs", ".js", ".json"], }, **kwargs ) def esbuild_checked_in(name, **kwargs): esbuild_esm_bundle( name = "%s_generated" % name, # Unfortunately we need to omit source maps from the checked-in files as these # will vary based on the platform. See more details below in the sanitization # genrule transformation. It is acceptable not having source-maps for the checked-in # files as those are not minified and its to debug, the checked-in file can be visited. sourcemap = "external", # We always disable minification for checked-in files as otherwise it will # become difficult determining potential differences. e.g. on Windows ESBuild # accidentally included `source-map-support` due to the missing sandbox. minify = False, **kwargs ) # ESBuild adds comments and function identifiers with the name of their module # location. e.g. `"bazel-out/x64_windows-fastbuild/bin/node_modules/a"function(exports)`. # We strip all of these paths as that would break approval of the he checked-in files within # different platforms (e.g. RBE running with K8). Additionally these paths depend # on the non-deterministic hoisting of the package manager across all platforms. native.genrule( name = "%s_sanitized" % name, srcs = ["%s_generated.js" % name], outs = ["%s_sanitized.js" % name], cmd = """cat $< | sed -E "s#(bazel-out|node_modules)/[^\\"']+##g" > $@""", ) generated_file_test( name = name, src = "%s.js" % name, generated = "%s_sanitized.js" % name, ) def generate_api_docs(**kwargs): _generate_api_docs( # We need to specify import mappings for Angular packages that import other Angular # packages. import_map = { # We only need to specify top-level entry-points, and only those that # are imported from other packages. "//packages/animations:index.ts": "@angular/animations", "//packages/common:index.ts": "@angular/common", "//packages/core:index.ts": "@angular/core", "//packages/forms:index.ts": "@angular/forms", "//packages/localize:index.ts": "@angular/localize", "//packages/platform-browser-dynamic:index.ts": "@angular/platform-browser-dynamic", "//packages/platform-browser:index.ts": "@angular/platform-browser", "//packages/platform-server:index.ts": "@angular/platform-server", "//packages/router:index.ts": "@angular/router", "//packages/upgrade:index.ts": "@angular/upgrade", }, **kwargs )
{ "end_byte": 27940, "start_byte": 20388, "url": "https://github.com/angular/angular/blob/main/tools/defaults.bzl" }
angular/tools/gulp-tasks/README.md_0_826
# Gulp Tasks folder This folder contains one file for each task (or group of related tasks) for the project's gulpfile. The dependencies between the tasks is kept in the gulpfile. ## Task File Structure Each task is defined by a factory function that accepts `gulp` as a parameter. Each file exports either one factory or an object of factories. E.g. The `build.js` file contains only one task: ```js module.exports = (gulp) => (done) => { ... }; ``` ## Loading Tasks The tasks are loaded in the gulp file, by requiring them. There is a helper called `loadTask(fileName, taskName)` will do this for us, where the `taskName` is optional if the file only exports one task. E.g. Loading the task that will run the build, from a task file that contains only one task. ```js gulp.task('build.sh', loadTask('build')); ```
{ "end_byte": 826, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/gulp-tasks/README.md" }
angular/tools/gulp-tasks/changelog-zonejs.js_0_1090
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ module.exports = (gulp) => () => { const tag = process.env.TAG; const ptag = process.env.PREVIOUS_ZONE_TAG; const conventionalChangelog = require('gulp-conventional-changelog'); // the tag of zone.js will start with `zone.js-`, such as `zone.js-0.10.0` // we will remove the first 8 (zone.js-) chars to get the real version. const version = tag.replace(/^zone\.js-/, ''); return gulp .src('packages/zone.js/CHANGELOG.md') .pipe( conventionalChangelog( { preset: 'angular', }, {linkCompare: true, previousTag: ptag, currentTag: tag, version: version}, { // Ignore commits that have a different scope than `zone.js`. extendedRegexp: true, grep: '^[^(]+\\(zone\\.js\\)', from: ptag, to: 'HEAD', }, ), ) .pipe(gulp.dest('./packages/zone.js/')); };
{ "end_byte": 1090, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/gulp-tasks/changelog-zonejs.js" }
angular/tools/saucelabs/sauce-service.sh_0_7629
#!/usr/bin/env bash set -u -e -o pipefail #################################################################################################### # Some helper funtions @echo() { echo "# $*" } @warn() { @echo "Warning: $*" >&2 } @fail() { @echo "Error! $*" >&2 exit 1 } @remove() { local f="$1" if [[ -f ${f} ]]; then @echo "Removing ${f}" rm -f "${f}" || @fail "Can not delete ${f} file" fi } @kill() { for p in $1; do if kill -0 ${p} >/dev/null 2>&1; then kill ${p} sleep 2 if kill -0 ${p} >/dev/null 2>&1; then kill -9 ${p} sleep 2 fi fi done } @wait_for() { local m="$1" local f="$2" if [[ ! -f "${f}" ]]; then printf "# ${m} (${f})" while [[ ! -f "${f}" ]]; do printf "." sleep 0.5 done printf "\n" fi } #################################################################################################### # Sauce service functions readonly SCRIPT_DIR=$(cd $(dirname $0); pwd) readonly TMP_DIR="/tmp/angular/sauce-service" mkdir -p ${TMP_DIR} # Location for the saucelabs log file. readonly SAUCE_LOG_FILE="${TMP_DIR}/sauce-connect.log" # Location for the saucelabs ready to connection process id lock file. readonly SAUCE_PID_FILE="${TMP_DIR}/sauce-connect.pid" # Location for the saucelabs ready to connect lock file. readonly SAUCE_READY_FILE="${TMP_DIR}/sauce-connect.lock" # Location for the saucelabs params file for use by test runner. readonly SAUCE_PARAMS_JSON_FILE="${TMP_DIR}/sauce-connect-params.json" # Amount of seconds we wait for sauceconnect to establish a tunnel instance. In order to not # acquire CircleCI instances for too long if sauceconnect fails, we need a connect timeout. readonly SAUCE_READY_FILE_TIMEOUT=120 readonly SERVICE_LOCK_FILE="${TMP_DIR}/service.lock" readonly SERVICE_START_FILE="${TMP_DIR}/service.start" readonly SERVICE_PID_FILE="${TMP_DIR}/service.pid" readonly SERVICE_LOG_FILE="${TMP_DIR}/service.log" service-setup-command() { if [[ -z "${SAUCE_USERNAME:-}" ]]; then @fail "SAUCE_USERNAME environment variable required" fi if [[ -z "${SAUCE_ACCESS_KEY:-}" ]]; then @fail "SAUCE_ACCESS_KEY environment variable required" fi if [[ -z "${SAUCE_TUNNEL_IDENTIFIER:-}" ]]; then @fail "SAUCE_TUNNEL_IDENTIFIER environment variable required" fi if [[ -z "${SAUCE_CONNECT:-}" ]]; then local unameOut="$(uname -s)" case "${unameOut}" in Linux*) local machine=linux ;; Darwin*) local machine=darwin ;; CYGWIN*) local machine=windows ;; MINGW*) local machine=windows ;; MSYS_NT*) local machine=windows ;; *) local machine=linux printf "\nUnrecongized uname '${unameOut}'; defaulting to use node for linux.\n" >&2 printf "Please file an issue to https://github.com/bazelbuild/rules_nodejs/issues if \n" >&2 printf "you would like to add your platform to the supported rules_nodejs node platforms.\n\n" >&2 ;; esac case "${machine}" in # Path to sauce connect executable linux) if [[ -z "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then # Started manually readonly connectVersion="sc-4.9.2-linux" readonly connectHash="2f8a3f87e1da4dc9a41bc45ec7c3a2ecdba4c72d72b7d0193f04ad66c5809104" echo "Downloading Sauce Connect" curl https://saucelabs.com/downloads/${connectVersion}.tar.gz -o ${SCRIPT_DIR}/${connectVersion}.tar.gz echo "${connectHash} ${SCRIPT_DIR}/${connectVersion}.tar.gz" | shasum -a 256 -c tar -xzf ${SCRIPT_DIR}/${connectVersion}.tar.gz -C ${SCRIPT_DIR} SAUCE_CONNECT="${SCRIPT_DIR}/${connectVersion}/bin/sc" else # Started via `bazel run` SAUCE_CONNECT="${BUILD_WORKSPACE_DIRECTORY}/node_modules/sauce-connect/bin/sc" fi ;; *) if [[ -z "${SAUCE_CONNECT:-}" ]]; then @fail "SAUCE_CONNECT environment variable is required on non-linux environments" exit 1 fi ;; esac fi if [[ ! -f ${SAUCE_CONNECT} ]]; then @fail "sc binary not found at ${SAUCE_CONNECT}" fi echo "{ \"SAUCE_USERNAME\": \"${SAUCE_USERNAME}\", \"SAUCE_ACCESS_KEY\": \"${SAUCE_ACCESS_KEY}\", \"SAUCE_TUNNEL_IDENTIFIER\": \"${SAUCE_TUNNEL_IDENTIFIER}\", \"SAUCE_LOCALHOST_ALIAS_DOMAIN\": \"${SAUCE_LOCALHOST_ALIAS_DOMAIN:-}\" }" > ${SAUCE_PARAMS_JSON_FILE} # Command arguments that will be passed to sauce-connect. # By default we disable SSL bumping for all requests. This is because SSL bumping is # not needed for our test setup and in order to perform the SSL bumping, Saucelabs # intercepts all HTTP requests in the tunnel VM and modifies them. This can cause # flakiness as it makes all requests dependent on the SSL bumping middleware. # See: https://wiki.saucelabs.com/display/DOCS/Troubleshooting+Sauce+Connect#TroubleshootingSauceConnect-DisablingSSLBumping local sauce_args=( "--no-ssl-bump-domains all" "--logfile ${SAUCE_LOG_FILE}" "--pidfile ${SAUCE_PID_FILE}" "--readyfile ${SAUCE_READY_FILE}" "--tunnel-identifier ${SAUCE_TUNNEL_IDENTIFIER}" "--user ${SAUCE_USERNAME}" # Don't add the --api-key here so we don't echo it out in service-pre-start ) if [[ -n "${SAUCE_LOCALHOST_ALIAS_DOMAIN:-}" ]]; then # Ensures that requests to the localhost alias domain are always resolved through the tunnel. # This environment variable is usually configured on CI, and refers to a domain that has been # locally configured in the current machine's hosts file (e.g. `/etc/hosts`). The domain should # resolve to the current machine in Saucelabs VMs, so we need to ensure that it is resolved # through the tunnel we going to create. sauce_args+=("--tunnel-domains ${SAUCE_LOCALHOST_ALIAS_DOMAIN}") fi @echo "Sauce connect will be started with:" echo " ${SAUCE_CONNECT} ${sauce_args[@]}" SERVICE_COMMAND="${SAUCE_CONNECT} ${sauce_args[@]} --api-key ${SAUCE_ACCESS_KEY}" } # Called by pre-start & post-stop service-cleanup() { if [[ -f "${SAUCE_PID_FILE}" ]]; then local p=$(cat "${SAUCE_PID_FILE}") @echo "Stopping Sauce Connect (pid $p)..." @kill $p fi @remove "${SAUCE_PID_FILE}" @remove "${SAUCE_READY_FILE}" @remove "${SAUCE_PARAMS_JSON_FILE}" } # Called before service is setup service-pre-setup() { service-cleanup } # Called after service is setup service-post-setup() { @echo " sauce params : ${SAUCE_PARAMS_JSON_FILE}" } # Called before service is started service-pre-start() { return } # Called after service is started service-post-start() { if [[ ! -f "${SAUCE_PID_FILE}" ]]; then printf "# Waiting for Sauce Connect Proxy process (${SAUCE_PID_FILE})" while [[ ! -f "${SAUCE_PID_FILE}" ]]; do if ! @serviceStatus >/dev/null 2>&1; then printf "\n" @serviceStop @echo "Service failed to start!" service-failed-setup exit 1 fi printf "." sleep 0.5 done printf "\n" fi @echo "Sauce Connect Proxy started (pid $(cat "${SAUCE_PID_FILE}"))" } # Called if service fails to start service-failed-setup() { if [[ -f "${SERVICE_LOG_FILE}" ]]; then @echo "tail ${SERVICE_LOG_FILE}:" echo "--------------------------------------------------------------------------------" tail "${SERVICE_LOG_FILE}" echo "--------------------------------------------------------------------------------" echo "^^^^^ ${SERVICE_LOG_FILE} ^^^^^" fi } # Called by ready-wait action
{ "end_byte": 7629, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs/sauce-service.sh" }
angular/tools/saucelabs/sauce-service.sh_7630_13416
service-ready-wait() { if [[ ! -f "${SAUCE_PID_FILE}" ]]; then @fail "Sauce Connect not running" fi if [[ ! -f "${SAUCE_READY_FILE}" ]]; then # Wait for saucelabs tunnel to connect printf "# Waiting for saucelabs tunnel to connect (${SAUCE_READY_FILE})" counter=0 while [[ ! -f "${SAUCE_READY_FILE}" ]]; do counter=$((counter + 1)) # Counter needs to be multiplied by two because the while loop only sleeps a half second. # This has been made in favor of better progress logging (printing dots every half second) if [ $counter -gt $[${SAUCE_READY_FILE_TIMEOUT} * 2] ]; then @echo "Timed out after ${SAUCE_READY_FILE_TIMEOUT} seconds waiting for tunnel ready file." if [[ -f "${SAUCE_LOG_FILE}" ]]; then echo "================================================================================" echo "${SAUCE_LOG_FILE}:" cat "${SAUCE_LOG_FILE}" fi exit 5 fi printf "." sleep 0.5 done printf "\n" @echo "Saucelabs tunnel connected" else @echo "Saucelabs tunnel already connected" fi } # Called before service is stopped service-pre-stop() { return } # Called after service is stopped service-post-stop() { service-cleanup } #################################################################################################### # Generic service functions # This uses functions setup above but nothing below should be specific to saucelabs @serviceLock() { # Check is Lock File exists, if not create it and set trap on exit printf "# Waiting for service action lock (${SERVICE_LOCK_FILE})" while true; do if { set -C; 2>/dev/null >"${SERVICE_LOCK_FILE}"; }; then trap "rm -f \"${SERVICE_LOCK_FILE}\"" EXIT printf "\n" break fi printf "." sleep 0.5 done @echo "Acquired service action lock" } @serviceStatus() { if [ -f "${SERVICE_PID_FILE}" ] && [ ! -z "$(cat "${SERVICE_PID_FILE}")" ]; then local p=$(cat "${SERVICE_PID_FILE}") if kill -0 $p >/dev/null 2>&1; then @echo "Service is running (pid $p)" return 0 else @echo "Service is not running (process PID $p not exists)" return 1 fi else @echo "Service is not running" return 2 fi } @serviceSetup() { if @serviceStatus >/dev/null 2>&1; then @echo "Service already running (pid $(cat "${SERVICE_PID_FILE}"))" return 0 fi @echo "Setting up service..." @remove "${SERVICE_PID_FILE}" @remove "${SERVICE_START_FILE}" touch "${SERVICE_LOG_FILE}" >/dev/null 2>&1 || @fail "Can not create ${SERVICE_LOG_FILE} file" @echo " service pid : ${SERVICE_PID_FILE}" @echo " service logs : ${SERVICE_LOG_FILE}" service-pre-setup service-setup-command ( ( if [[ -z "${SERVICE_COMMAND:-}" ]]; then @fail "No SERVICE_COMMAND is set" fi @wait_for "Waiting for start file" "${SERVICE_START_FILE}" ${SERVICE_COMMAND} ) >>"${SERVICE_LOG_FILE}" 2>&1 ) & echo $! >"${SERVICE_PID_FILE}" if @serviceStatus >/dev/null 2>&1; then @echo "Service setup (pid $(cat "${SERVICE_PID_FILE}"))" service-post-setup else @echo "Error setting up Service!" service-failed-setup exit 1 fi return $? } @serviceStart() { if @serviceStatus >/dev/null 2>&1; then @echo "Service already setup (pid $(cat "${SERVICE_PID_FILE}"))" else @serviceSetup fi if [[ -f "${SERVICE_START_FILE}" ]]; then @echo "Service already started" else @echo "Starting service..." service-pre-start touch "${SERVICE_START_FILE}" >/dev/null 2>&1 || @err "Can not create ${SERVICE_START_FILE} file" service-post-start @echo "Service started" fi } @serviceStop() { if @serviceStatus >/dev/null 2>&1; then touch "${SERVICE_PID_FILE}" >/dev/null 2>&1 || @fail "Can not touch ${SERVICE_PID_FILE} file" service-pre-stop @echo "Stopping service (pid $(cat "${SERVICE_PID_FILE}"))..." @kill $(cat "${SERVICE_PID_FILE}") if @serviceStatus >/dev/null 2>&1; then @fail "Error stopping Service! Service already running with PID $(cat "${SERVICE_PID_FILE}")" else @echo "Service stopped" @remove "${SERVICE_PID_FILE}" @remove "${SERVICE_START_FILE}" service-post-stop fi return 0 else @warn "Service is not running" @remove "${SERVICE_PID_FILE}" @remove "${SERVICE_START_FILE}" service-post-stop fi } @serviceStartReadyWait() { @serviceStart @serviceReadyWait } @serviceReadyWait() { service-ready-wait } @serviceRestart() { @serviceStop @serviceStart } @serviceTail() { @echo "tail ${SERVICE_LOG_FILE}:" tail -f "${SERVICE_LOG_FILE}" } @serviceLog() { @echo "cat ${SERVICE_LOG_FILE}:" echo "--------------------------------------------------------------------------------" cat "${SERVICE_LOG_FILE}" echo "--------------------------------------------------------------------------------" echo "^^^^^ ${SERVICE_LOG_FILE} ^^^^^" } case "${1:-}" in setup) @serviceLock @serviceSetup ;; start) @serviceLock @serviceStart ;; start-ready-wait) @serviceLock @serviceStartReadyWait ;; ready-wait) @serviceLock @serviceReadyWait ;; stop) @serviceLock @serviceStop ;; restart) @serviceLock @serviceRestart ;; status) @serviceLock @serviceStatus ;; run) ( service-setup-command if [[ -z "${SERVICE_COMMAND:-}" ]]; then @fail "No SERVICE_COMMAND is set" fi ${SERVICE_COMMAND} ) ;; log) @serviceLog ;; tail) @serviceTail ;; *) @echo "Actions: [setup|start|start-read-wait|ready-wait|stop|restart|status|run|tail]" exit 1 ;; esac
{ "end_byte": 13416, "start_byte": 7630, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs/sauce-service.sh" }
angular/tools/saucelabs/README.md_0_75
# Saucelabs testing with Bazel Moved to tools/saucelabs-daemon/README.md.
{ "end_byte": 75, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs/README.md" }
angular/tools/saucelabs/BUILD.bazel_0_1562
package(default_visibility = ["//visibility:public"]) sh_binary( name = "sauce_service_setup", srcs = ["sauce-service.sh"], args = ["setup"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_start", srcs = ["sauce-service.sh"], args = ["start"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_start_ready_wait", srcs = ["sauce-service.sh"], args = ["start-ready-wait"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_ready_wait", srcs = ["sauce-service.sh"], args = ["ready-wait"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_stop", srcs = ["sauce-service.sh"], args = ["stop"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_tail", srcs = ["sauce-service.sh"], args = ["tail"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, ) sh_binary( name = "sauce_service_log", srcs = ["sauce-service.sh"], args = ["log"], data = ["//:sauce_connect"], env = { "SAUCE_CONNECT": "$(rootpath //:sauce_connect)", }, )
{ "end_byte": 1562, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs/BUILD.bazel" }
angular/tools/esm-interop/esm-node-module-loader.mjs_0_5464
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import fs from 'fs'; import path from 'path'; import {createRequire} from 'module'; import {pathToFileURL} from 'url'; import {resolve as resolveExports} from '../../third_party/github.com/lukeed/resolve.exports/index.mjs'; // The Bazel NodeJS rules patch `require` to support first-party // mapped packages. We cannot replicate this logic without patching // the Bazel rules, so instead we leverage the existing `require` // patched function as it knows about first party mapped packages. const requireFn = createRequire(import.meta.url); const npmDepsWorkspace = process.env.NODE_MODULES_WORKSPACE_NAME ?? ''; const runfilesRoot = path.resolve(process.env.RUNFILES); const nodeModulesPath = path.join(runfilesRoot, npmDepsWorkspace, 'node_modules'); /* Custom module loader to support loading 1st-party and 3rd-party node modules when the linker is disabled. This is required because `rules_nodejs` only patches requires in cjs modules when the linker is disabled. */ export async function resolve(specifier, context, nextResolve) { // Only activate this loader when explicitly enabled. if (process.env.ESM_NODE_MODULE_LOADER_ENABLED !== 'true') { return nextResolve(specifier, context); } if (!isNodeOrNpmPackageImport(specifier)) { return nextResolve(specifier, context); } // Attempt the next (or builtin) resolution first. let nextResolveError = null; try { return await nextResolve(specifier, context); } catch (e) { nextResolveError = e; } const packageImport = parsePackageImport(specifier); const pathToNodeModule = path.join(nodeModulesPath, packageImport.packageName); // If the module can be directly found in the `node_modules`, then we know it's // a third-party package coming from NPM. In this case we properly respect ESM // resolution by respecting the `exports`. const npmModuleResult = fs.existsSync(pathToNodeModule) ? resolvePackageWithExportsSupport(pathToNodeModule, packageImport) : null; if (npmModuleResult !== null) { return npmModuleResult; } // If the package does not exist on disk, then it may just be an invalid // import, or the package is 1st-party one that is mapped within Bazel. // We attempt to resolve it that way and return the path if there is a result. const localMappingResult = tryResolveViaLocalMappings(specifier, packageImport); if (localMappingResult !== null) { return localMappingResult; } // Re-throw the next resolve error if the we couldn't find the module. throw nextResolveError; } /** Gets whether the specifier refers to a module. */ function isNodeOrNpmPackageImport(specifier) { return ( !specifier.startsWith('./') && !specifier.startsWith('../') && !specifier.startsWith('node:') && !specifier.startsWith('file:') ); } /** * Attempts to resolve a specifier using the Bazel patched resolution, * supporting first-party package mappings from `rules_nodejs`. */ function tryResolveViaLocalMappings(actualSpecifier) { try { const res = requireFn.resolve(actualSpecifier); // Note: It may not resolve to a path if the specifier is a builtin // module. In such cases we do not want to return it as result. if (fs.existsSync(res)) { return {url: pathToFileURL(res).href}; } } catch {} return null; } /** Parses the given specifier into its package and subpath. */ function parsePackageImport(specifier) { const [, packageName, pathInPackage = ''] = /^((?:@[^/]+\/)?[^/]+)(?:\/(.+))?$/.exec(specifier) ?? []; if (!packageName) { throw new Error(`Could not parse package name import statement '${specifier}'`); } return {packageName, pathInPackage, specifier}; } /** Resolves an import to a module by respecting the `package.json` `exports`. */ function resolvePackageWithExportsSupport(pathToNodeModule, packageImport) { const packageJson = JSON.parse( fs.readFileSync(path.join(pathToNodeModule, 'package.json'), 'utf8') ); const localResolvedPackagePath = resolvePackageLocalFilepath( pathToNodeModule, packageImport, packageJson ); if (fs.existsSync(localResolvedPackagePath)) { return {url: pathToFileURL(localResolvedPackagePath).href}; } return null; } /** * Resolves the remaining package-local portion of an import. Leverages * the `package.json` `exports` field information for resolution. */ function resolvePackageLocalFilepath(pathToNodeModule, packageImport, packageJson) { if (packageJson.exports) { return path.join(pathToNodeModule, resolveExports(packageJson, packageImport.specifier)); } let pkgJsonDir = pathToNodeModule; // If we couldn't resolve the subpath via `exports`, we check if the subpath // already points to an explicit file, or respect deep `package.json` files. if (packageImport.pathInPackage !== '') { const fullPath = path.join(pathToNodeModule, packageImport.pathInPackage); const deepPackageJsonPath = path.join(fullPath, 'package.json'); if (fs.existsSync(deepPackageJsonPath)) { pkgJsonDir = fullPath; packageJson = JSON.parse(fs.readFileSync(deepPackageJsonPath, 'utf8')); } else { return fullPath; } } return path.join(pkgJsonDir, packageJson.module || packageJson.main || 'index.js'); }
{ "end_byte": 5464, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/esm-node-module-loader.mjs" }
angular/tools/esm-interop/index.bzl_0_380
"""ESM interop helpers.""" load("//tools/esm-interop:nodejs-rules.bzl", _nodejs_binary = "nodejs_binary", _nodejs_test = "nodejs_test") load("//tools/esm-interop:esm-node-module-loader.bzl", _enable_esm_node_module_loader = "enable_esm_node_module_loader") nodejs_binary = _nodejs_binary nodejs_test = _nodejs_test enable_esm_node_module_loader = _enable_esm_node_module_loader
{ "end_byte": 380, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/index.bzl" }
angular/tools/esm-interop/esm-main-loader.mjs_0_1309
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {extname} from 'path'; import {fileURLToPath} from 'url'; import * as extensionLoader from './esm-extension-loader.mjs'; import * as nodeModuleLoader from './esm-node-module-loader.mjs'; const loaders = [extensionLoader, nodeModuleLoader]; export async function resolve(initialSpecifier, initialCtx, defaultResolve) { let nextFn = (i) => (s, c) => { if (i === loaders.length) { return defaultResolve(s, c, defaultResolve); } return loaders[i].resolve(s, c, nextFn(i + 1)); }; return nextFn(0)(initialSpecifier, initialCtx); } export async function load(url, context, defaultLoad) { // Using `--loader` causes non-ESM extension-less files like // for `typescript/bin/tsc` to be considered as ESM. This is a bug // via: https://github.com/nodejs/node/issues/33226. // Workaround is to load such extension-less files as CommonJS. Similar // to how they are loaded without `--loader` being specified. if (url.startsWith('file://') && extname(fileURLToPath(url)) === '') { context.format = 'commonjs'; } return defaultLoad(url, context, defaultLoad); }
{ "end_byte": 1309, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/esm-main-loader.mjs" }
angular/tools/esm-interop/nodejs-rules.bzl_0_1640
"""Macros for extending the NodeJS Bazel rules with ESM support.""" load("@build_bazel_rules_nodejs//:index.bzl", _nodejs_binary = "nodejs_binary", _nodejs_test = "nodejs_test") load("//tools/esm-interop:esm-node-module-loader.bzl", "enable_esm_node_module_loader") def nodejs_binary( name, linker_enabled = False, npm_workspace = "npm", **kwargs): env = kwargs.pop("env", {}) testonly = kwargs.pop("testonly", False) entry_point = kwargs.pop("entry_point", None) # Ensure ESM entry-points are not resolved to their link target. templated_args = kwargs.pop("templated_args", []) templated_args = templated_args + ["--node_options=--preserve-symlinks-main"] if not linker_enabled: env = enable_esm_node_module_loader(npm_workspace, env) _nodejs_binary( name = name, testonly = testonly, entry_point = str(entry_point).replace(".js", ".mjs"), env = env, templated_args = templated_args, use_esm = True, **kwargs ) def nodejs_test( name, linker_enabled = False, npm_workspace = "npm", **kwargs): env = kwargs.pop("env", {}) # Ensure ESM entry-points are not resolved to their link target. templated_args = kwargs.pop("templated_args", []) templated_args = templated_args + ["--node_options=--preserve-symlinks-main"] if not linker_enabled: env = enable_esm_node_module_loader(npm_workspace, env) _nodejs_test( name = name, env = env, templated_args = templated_args, use_esm = True, **kwargs )
{ "end_byte": 1640, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/nodejs-rules.bzl" }
angular/tools/esm-interop/esm-extension-loader.mjs_0_2363
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ const explicitExtensionRe = /\.[mc]?js$/; const explicitJsExtensionRe = /\.js$/; const builtinNamespaceImportRe = /^node:/; /* * NodeJS resolver that enables the interop with the current Bazel setup. * * The loader will attempt resolution by replacing explicit extension with * their ESM variants. It also tries completing import specifiers in case no * extension of explicit file is specified. * * There are a few cases: * * * Relative imports without an extension. This happens because our * source files cannot use explicit `.mjs` extensions yet. * * Relative imports with an explicit extension to `.js`. This may * be generated by TypeScript as we have `.ts` source files. * * Local module imports. In NPM, extensions are not needed as the * `package.json` `exports` help resolving. In Bazel when dealing with * 1st-party packages- `package.json` is not consulted in resolution. * 1. The NPM artifacts differ from the source compilation output. * 2. It results in additional churn, having to put `package.json` into `bin`. */ export async function resolve(specifier, context, nextResolve) { const interopAttempts = []; if (explicitJsExtensionRe.test(specifier)) { interopAttempts.push(specifier.replace(explicitJsExtensionRe, '.mjs')); } // If there is no explicit extension and we are not dealing with a // builtin namespace module, attempt various subpaths to prioritize ESM. if (!explicitExtensionRe.test(specifier) && !builtinNamespaceImportRe.test(specifier)) { interopAttempts.push(`${specifier}.mjs`); interopAttempts.push(`${specifier}/index.mjs`); // Last attempts are normal `.js` extensions. These could still // be valid ESM when there is an type:module `package.json` file interopAttempts.push(`${specifier}.js`); interopAttempts.push(`${specifier}/index.js`); } for (const attempt of interopAttempts) { try { return await nextResolve(attempt, context); } catch {} } // Original specifier is attempted at the end because // we want to prioritize the ESM variants first. return await nextResolve(specifier, context); }
{ "end_byte": 2363, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/esm-extension-loader.mjs" }
angular/tools/esm-interop/esm-node-module-loader.bzl_0_611
"""ESM node module loader helpers.""" def enable_esm_node_module_loader( node_modules_workspace, env): """Enables a NodeJS import loader that ensures modules can be resolved from the Bazel repository. Args: node_modules_workspace: Name of the workspace in which node modules are available. env: Struct of environment variables passed to a binary/test. Returns: The updated `env` dictionary. """ env = dict( env, NODE_MODULES_WORKSPACE_NAME = node_modules_workspace, ESM_NODE_MODULE_LOADER_ENABLED = "true", ) return env
{ "end_byte": 611, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/esm-node-module-loader.bzl" }
angular/tools/esm-interop/BUILD.bazel_0_321
package(default_visibility = ["//visibility:public"]) exports_files([ "esm-main-loader.mjs", ]) filegroup( name = "loaders", srcs = [ "esm-extension-loader.mjs", "esm-main-loader.mjs", "esm-node-module-loader.mjs", "//third_party/github.com/lukeed/resolve.exports", ], )
{ "end_byte": 321, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/esm-interop/BUILD.bazel" }
angular/tools/tslint/requireInternalWithUnderscoreRule.ts_0_1846
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {RuleFailure} from 'tslint/lib'; import {RuleWalker} from 'tslint/lib/language/walker'; import {AbstractRule} from 'tslint/lib/rules'; import ts from 'typescript'; export class Rule extends AbstractRule { override apply(sourceFile: ts.SourceFile): RuleFailure[] { const typedefWalker = new TypedefWalker(sourceFile, this.getOptions()); return this.applyWithWalker(typedefWalker); } } class TypedefWalker extends RuleWalker { protected visitPropertyDeclaration(node: ts.PropertyDeclaration): void { this.assertInternalAnnotationPresent(node); super.visitPropertyDeclaration(node); } public visitMethodDeclaration(node: ts.MethodDeclaration): void { this.assertInternalAnnotationPresent(node); super.visitMethodDeclaration(node); } private hasInternalAnnotation(range: ts.CommentRange): boolean { const text = this.getSourceFile().text; const comment = text.substring(range.pos, range.end); return comment.indexOf('@internal') >= 0; } private assertInternalAnnotationPresent(node: ts.NamedDeclaration) { if (node.name && node.name.getText().charAt(0) !== '_') return; if (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Private) return; const ranges = ts.getLeadingCommentRanges(this.getSourceFile().text, node.pos); if (ranges) { for (let i = 0; i < ranges.length; i++) { if (this.hasInternalAnnotation(ranges[i])) return; } } this.addFailure( this.createFailure( node.getStart(), node.getWidth(), `module-private member ${node.name?.getText()} must be annotated @internal`, ), ); } }
{ "end_byte": 1846, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/tslint/requireInternalWithUnderscoreRule.ts" }
angular/tools/tslint/tsNodeLoaderRule.js_0_679
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ const path = require('path'); const Lint = require('tslint'); // Custom rule that registers all of the custom rules, written in TypeScript, with ts-node. // This is necessary, because `tslint` and IDEs won't execute any rules that aren't in a .js file. require('ts-node').register({ project: path.join(__dirname, '../../tsconfig-tslint.json'), }); // Add a noop rule so tslint doesn't complain. exports.Rule = class Rule extends Lint.Rules.AbstractRule { apply() {} };
{ "end_byte": 679, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/tslint/tsNodeLoaderRule.js" }
angular/tools/contributing-stats/get-data.ts_0_8177
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * This script gets contribution stats for all members of the angular org, * since a provided date. * The script expects the following flag(s): * * required: * --since [date] The data after which contributions are queried for. * Uses githubs search format for dates, e.g. "2020-01-21". * See * https://help.github.com/en/github/searching-for-information-on-github/understanding-the-search-syntax#query-for-dates * * optional: * --use-created [boolean] If the created timestamp should be used for * time comparisons, defaults otherwise to the updated timestamp. */ import {graphql as unauthenticatedGraphql} from '@octokit/graphql'; import {alias, params, query as graphqlQuery, types} from 'typed-graphqlify'; import yargs from 'yargs'; // The organization to be considered for the queries. const ORG = 'angular'; // The repositories to be considered for the queries. const REPOS = ['angular', 'components', 'angular-cli']; /** * Handle flags for the script. */ const args = yargs .option('use-created', {type: 'boolean'}) .option('since', {type: 'string', demandOption: true}) .strictOptions().argv; /** * Authenticated instance of Github GraphQl API service, relies on a * personal access token being available in the TOKEN environment variable. */ const graphql = unauthenticatedGraphql.defaults({ headers: { // TODO(josephperrott): Remove reference to TOKEN environment variable as part of larger // effort to migrate to expecting tokens via GITHUB_ACCESS_TOKEN environment variables. authorization: `token ${process.env['TOKEN'] || process.env['GITHUB_ACCESS_TOKEN']}`, }, }); /** * Retrieves all current members of an organization. */ async function getAllOrgMembers() { // The GraphQL query object to get a page of members of an organization. const MEMBERS_QUERY = params( { $first: 'Int', // How many entries to get with each request $after: 'String', // The cursor to start the page at $owner: 'String!', // The organization to query for }, { organization: params( {login: '$owner'}, { membersWithRole: params( { first: '$first', after: '$after', }, { nodes: [{login: types.string}], pageInfo: { hasNextPage: types.boolean, endCursor: types.string, }, }, ), }, ), }, ); const query = graphqlQuery('members', MEMBERS_QUERY); /** * Gets the query and queryParams for a specific page of entries. */ const queryBuilder = (count: number, cursor?: string) => { return { query, params: { after: cursor || null, first: count, owner: ORG, }, }; }; // The current cursor let cursor = undefined; // If an additional page of members is expected let hasNextPage = true; // Array of Github usernames of the organization const members: string[] = []; while (hasNextPage) { const {query, params} = queryBuilder(100, cursor); const results = (await graphql(query.toString(), params)) as typeof MEMBERS_QUERY; results.organization.membersWithRole.nodes.forEach((node: {login: string}) => members.push(node.login), ); hasNextPage = results.organization.membersWithRole.pageInfo.hasNextPage; cursor = results.organization.membersWithRole.pageInfo.endCursor; } return members.sort(); } /** * Build metadata for making requests for a specific user and date. * * Builds GraphQL query string, Query Params and Labels for making queries to GraphQl. */ function buildQueryAndParams(username: string, date: string) { // Whether the updated or created timestamp should be used. const updatedOrCreated = args['use-created'] ? 'created' : 'updated'; let dataQueries: {[key: string]: {query: string; label: string}} = {}; // Add queries and params for all values queried for each repo. for (let repo of REPOS) { dataQueries = { ...dataQueries, [`${repo.replace(/[\/\-]/g, '_')}_issue_author`]: { query: `repo:${ORG}/${repo} is:issue author:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} Issue Authored`, }, [`${repo.replace(/[\/\-]/g, '_')}_issues_involved`]: { query: `repo:${ORG}/${repo} is:issue -author:${username} involves:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} Issue Involved`, }, [`${repo.replace(/[\/\-]/g, '_')}_pr_author`]: { query: `repo:${ORG}/${repo} is:pr author:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} PR Author`, }, [`${repo.replace(/[\/\-]/g, '_')}_pr_involved`]: { query: `repo:${ORG}/${repo} is:pr involves:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} PR Involved`, }, [`${repo.replace(/[\/\-]/g, '_')}_pr_reviewed`]: { query: `repo:${ORG}/${repo} is:pr -author:${username} reviewed-by:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} PR Reviewed`, }, [`${repo.replace(/[\/\-]/g, '_')}_pr_commented`]: { query: `repo:${ORG}/${repo} is:pr -author:${username} commenter:${username} ${updatedOrCreated}:>${date}`, label: `${ORG}/${repo} PR Commented`, }, }; } // Add queries and params for all values queried for the org. dataQueries = { ...dataQueries, [`${ORG}_org_issue_author`]: { query: `org:${ORG} is:issue author:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org Issue Authored`, }, [`${ORG}_org_issues_involved`]: { query: `org:${ORG} is:issue -author:${username} involves:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org Issue Involved`, }, [`${ORG}_org_pr_author`]: { query: `org:${ORG} is:pr author:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org PR Author`, }, [`${ORG}_org_pr_involved`]: { query: `org:${ORG} is:pr involves:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org PR Involved`, }, [`${ORG}_org_pr_reviewed`]: { query: `org:${ORG} is:pr -author:${username} reviewed-by:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org PR Reviewed`, }, [`${ORG}_org_pr_commented`]: { query: `org:${ORG} is:pr -author:${username} commenter:${username} ${updatedOrCreated}:>${date}`, label: `${ORG} org PR Commented`, }, }; /** * Gets the labels for each requested value to be used as headers. */ function getLabels(pairs: typeof dataQueries) { return Object.values(pairs).map((val) => val.label); } /** * Gets the graphql query object for the GraphQL query. */ function getQuery(pairs: typeof dataQueries) { const output: {[key: string]: {}} = {}; Object.entries(pairs).map(([key, val]) => { output[alias(key, 'search')] = params( { query: `"${val.query}"`, type: 'ISSUE', }, { issueCount: types.number, }, ); }); return output; } return { query: graphqlQuery(getQuery(dataQueries)), labels: getLabels(dataQueries), }; } /** * Runs the script to create a CSV string with the requested data for each member * of the organization. */ async function run(date: string) { try { const allOrgMembers = await getAllOrgMembers(); console.info(['Username', ...buildQueryAndParams('', date).labels].join(',')); for (const username of allOrgMembers) { const results = await graphql(buildQueryAndParams(username, date).query.toString()); const values = Object.values(results).map((result) => `${result.issueCount}`); console.info([username, ...values].join(',')); } } catch (error) { console.error(`Error: ${error.message}`); process.exit(1); } } run(args['since']);
{ "end_byte": 8177, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/contributing-stats/get-data.ts" }
angular/tools/testing/browser_tests.init.ts_0_840
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import 'zone.js/lib/browser/rollup-main'; import './zone_base_setup'; import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports. import {TestBed} from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; TestBed.initTestEnvironment( [BrowserDynamicTestingModule, NoopAnimationsModule], platformBrowserDynamicTesting(), ); (window as any).isNode = false; (window as any).isBrowser = true; (window as any).global = window;
{ "end_byte": 840, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/browser_tests.init.ts" }
angular/tools/testing/zone_base_setup.ts_0_871
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import 'reflect-metadata'; import {patchLongStackTrace} from 'zone.js/lib/zone-spec/long-stack-trace'; import {patchTaskTracking} from 'zone.js/lib/zone-spec/task-tracking'; import {patchProxyZoneSpec} from 'zone.js/lib/zone-spec/proxy'; import {patchSyncTest} from 'zone.js/lib/zone-spec/sync-test'; import {patchAsyncTest} from 'zone.js/lib/zone-spec/async-test'; import {patchFakeAsyncTest} from 'zone.js/lib/zone-spec/fake-async-test'; import {patchJasmine} from 'zone.js/lib/jasmine/jasmine'; patchLongStackTrace(Zone); patchTaskTracking(Zone); patchProxyZoneSpec(Zone); patchSyncTest(Zone); patchAsyncTest(Zone); patchFakeAsyncTest(Zone); patchJasmine(Zone);
{ "end_byte": 871, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/zone_base_setup.ts" }
angular/tools/testing/node_tests.init.ts_0_991
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import 'zone.js/lib/node/rollup-main'; import './zone_base_setup'; (global as any).isNode = true; (global as any).isBrowser = false; import '@angular/compiler'; // For JIT mode. Must be in front of any other @angular/* imports. // Init TestBed import {TestBed} from '@angular/core/testing'; import { ServerTestingModule, platformServerTesting, } from '@angular/platform-server/testing/src/server'; import {DominoAdapter} from '@angular/platform-server/src/domino_adapter'; import domino from '../../packages/platform-server/src/bundled-domino'; TestBed.initTestEnvironment(ServerTestingModule, platformServerTesting()); DominoAdapter.makeCurrent(); (global as any).document = (DominoAdapter as any).defaultDoc || ((DominoAdapter as any).defaultDoc = domino.createDocument());
{ "end_byte": 991, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/node_tests.init.ts" }
angular/tools/testing/README.md_0_469
The spec helper files here set up the global testing environment prior to the execution of specs. There are 3 options: * `init_node_spec` - configures a node environment to test Angular applications with platform-server. * `init_node_no_angular_spec` - configures a node environment for testing without setting up Angular's testbed (no dependency on Angular packages is incurred). * `init_browser_spec` - configures a browser environment to test Angular applications.
{ "end_byte": 469, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/README.md" }
angular/tools/testing/node_no_angular_tests.init.ts_0_270
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (global as any).isNode = true; (global as any).isBrowser = false;
{ "end_byte": 270, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/node_no_angular_tests.init.ts" }
angular/tools/testing/BUILD.bazel_0_2517
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "zone_base_setup_lib", testonly = 1, srcs = ["zone_base_setup.ts"], deps = [ "//packages/zone.js/lib", "@npm//reflect-metadata", ], ) ts_library( name = "browser", testonly = 1, srcs = ["browser_tests.init.ts"], deps = [ ":zone_base_setup_lib", "//packages/compiler", "//packages/core/testing", "//packages/platform-browser-dynamic/testing", "//packages/platform-browser/animations", "//packages/zone.js/lib", ], ) ts_library( name = "node", testonly = 1, srcs = ["node_tests.init.ts"], deps = [ ":zone_base_setup_lib", "//packages/compiler", "//packages/core/testing", "//packages/platform-server", "//packages/platform-server:bundled_domino_lib", "//packages/platform-server/testing", "//packages/zone.js/lib", ], ) ts_library( name = "node_no_angular", testonly = 1, srcs = ["node_no_angular_tests.init.ts"], deps = [ "//packages:types", ], ) # A test to verify that jasmine_node_test targets fail as expected. # This is to catch any future regressions to jasmine_node_test where # tests pass silently without executing. # See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example # of a potential regression. jasmine_node_test( name = "fail_test", srcs = ["fail.spec.js"], # While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4. # see: https://github.com/jasmine/jasmine-npm/blob/eea8b26efe29176ecbb26ce3f1c4990f8bede685/lib/jasmine.js#L213 expected_exit_code = 4, ) # A test to verify that jasmine_node_test targets fail as expected # when there is a bootstrap script set. # This is to catch any future regressions to jasmine_node_test where # tests pass silently without executing. # See https://github.com/bazelbuild/rules_nodejs/pull/1540 for an example # of a potential regression. jasmine_node_test( name = "fail_bootstrap_test", srcs = ["fail.spec.js"], bootstrap = ["//tools/testing:node"], # While we force the termination of the process with an exitCode of 55 in fail.spec.js. Jasmine force it to 4. # see: https://github.com/jasmine/jasmine-npm/blob/eea8b26efe29176ecbb26ce3f1c4990f8bede685/lib/jasmine.js#L213 expected_exit_code = 4, )
{ "end_byte": 2517, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/BUILD.bazel" }
angular/tools/testing/fail.spec.js_0_222
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ process.exit(55);
{ "end_byte": 222, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/testing/fail.spec.js" }
angular/tools/saucelabs-daemon/browser.ts_0_726
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** Definition of a test browser. */ export interface Browser { browserName: string; browserVersion?: string; platformName?: string; platformVersion?: string; deviceName?: string; } /** * Gets a unique id for the specified browser. This id can be shared * across the background service and launcher using IPC. */ export function getUniqueId(browser: Browser): string { let result = Object.keys(browser) .sort() .map((key) => `${key}=${browser[key as keyof Browser]}`); return result.join(':'); }
{ "end_byte": 726, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/browser.ts" }
angular/tools/saucelabs-daemon/README.md_0_4007
# Saucelabs testing with Bazel ## Local testing 1. Set up your `SAUCE_USERNAME`, `SAUCE_ACCESS_KEY` & `SAUCE_TUNNEL_IDENTIFIER` environment variables. These are required. You can find the values for `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` in `/.circleci/env.sh`. `SAUCE_TUNNEL_IDENTIFIER` can be set to any unique value. If you are having trouble running Saucelabs tests locally you can contact [Joey Perrott](https://github.com/josephperrott) or [Paul Gschwendtner](https://github.com/devversion) for support. 2. Once you have your environment variables set up, run the setup task in the root of the repo: ``` bash yarn bazel run //tools/saucelabs-daemon/background-service -- <number_of_browsers> ``` This will start a daemon process that will connect to Saucelabs and provision browsers once you start running your first test target. 3. In another terminal, you can run a particular test target through SauceLabs by suffixing the target name with "_saucelabs". For example, `packages/core/test:test_web` becomes `packages/core/test:test_web_saucelabs`. ``` yarn bazel test //packages/core/test:test_web_saucelabs ``` ## Additional test features To see the test output while the tests are running (as these are long tests), add the `--test_output=streamed` option. Note, this option will also prevent bazel from using the test cache and will force the test to run. For running all Saucelabs tests in the project, `bazel query` is used to gather up all karma Saucelabs test labels because they are otherwise hidden by the `manual` tag. Running all karma tests in Saucelabs: ``` bash ./scripts/test/run-saucelabs-tests.sh ``` to override the default number of parallel browsers to acquire on Saucelabs you pass an optional configuration parameters. For example, ``` bash ./scripts/test/run-saucelabs-tests.sh 5 ``` ## Under the hood The `//tools/saucelabs-daemon/background-service` target does not start the Sauce Connect proxy at start-up, but instead listens for the start signal from the saucelabs karma launcher. This signal is sent by saucelabs-daemon custom karma launcher `tools/saucelabs-daemon/launcher/launcher.ts`. This is necessary as the Sauce Connect Proxy process must be started outside of `bazel test` as Bazel will automatically kill any processes spawned during a test when that tests completes, which would prevent the tunnel & provisioned browsers from being shared by multiple tests. The karma_web_test rule for saucelabs must have a few important tags: * `no-remote-exec` as they cannot be executed remotely since tests need to communicate with the daemon. * `manual` so they are not automatically tested with `//...` * `saucelabs` so that they can be easily gathered up for testing in a `bazel query` These are added automatically the by `karma_web_test_suite` macro in `tools/defaults.bzl`. ## Debugging **Q: How do I get the tests to run on IE? I only see Chromium.** If you see something like this at the end of your test output, it means you're not actually running SauceLabs: ``` INFO: Build completed successfully, 43 total actions /packages/core/test:test_web_chromium ``` This is a common error caused by forgetting to suffix your test target with "_saucelabs". For example, `/packages/core/test:test_web` becomes `/packages/core/test:test_web_saucelabs`. **Q: How can I tell that the SauceLabs connection was successfully made?** There is a dashboard at saucelabs.com where you can see active tunnel connections (Angular has an account). As soon as you actually run the test target (not after the setup task), you should see an active tunnel connection under the SAUCE_TUNNEL_IDENTIFICATION_KEY you entered. If a tunnel connection is not there, you are not actually connecting with SauceLabs. Note: It may *look* like the tests are running because of the Bazel output. The progress Bazel is showing does not mean that SauceLabs is connected. If the tests are actually running, you should see the "..." test report for passing tests.
{ "end_byte": 4007, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/README.md" }
angular/tools/saucelabs-daemon/ipc-messages.ts_0_1235
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** Message that can be sent to the daemon to start a given test. */ export class StartTestMessage { readonly type = 'start-test'; constructor( public url: string, public browserId: string, public testDescription: string, ) {} } /** Message that can be sent to the daemon if a test completed. */ export class EndTestMessage { readonly type = 'end-test'; } /** Message being sent from the daemon if a request browser is not available. */ export class NoAvailableBrowserMessage { readonly type = 'browser-not-ready'; } /** Message that indicates an internal error in background service. */ export class InternalErrorMessage { readonly type = 'internal-error'; constructor(public msg: string) {} } /** Type of messages the background service can receive. */ export type BackgroundServiceReceiveMessages = StartTestMessage | EndTestMessage; /** Type of messages the background services can send to clients. */ export type BackgroundServiceSendMessages = NoAvailableBrowserMessage | InternalErrorMessage;
{ "end_byte": 1235, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/ipc-messages.ts" }
angular/tools/saucelabs-daemon/ipc-defaults.ts_0_234
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ export const IPC_PORT = 5324;
{ "end_byte": 234, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/ipc-defaults.ts" }
angular/tools/saucelabs-daemon/BUILD.bazel_0_240
load("//tools:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "saucelabs-daemon", srcs = [ "browser.ts", "ipc-defaults.ts", "ipc-messages.ts", ], )
{ "end_byte": 240, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/BUILD.bazel" }
angular/tools/saucelabs-daemon/launcher/launcher.ts_0_2645
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {createConnection, Socket} from 'net'; import {Browser, getUniqueId} from '../browser'; import {IPC_PORT} from '../ipc-defaults'; import {BackgroundServiceSendMessages, EndTestMessage, StartTestMessage} from '../ipc-messages'; export function SaucelabsLauncher( this: any, args: Browser, config: unknown, logger: any, baseLauncherDecorator: any, captureTimeoutLauncherDecorator: any, retryLauncherDecorator: any, ) { // Apply base class mixins. This would be nice to have typed, but this is a low-priority now. baseLauncherDecorator(this); captureTimeoutLauncherDecorator(this); retryLauncherDecorator(this); const log = logger.create('SaucelabsLauncher'); const browserDisplayName = args.browserName + (args.browserVersion ? ' ' + args.browserVersion : '') + (args.platformName ? ' (' + args.platformName + ')' : ''); const testSuiteDescription = process.env['TEST_TARGET'] ?? '<unknown>'; let daemonConnection: Socket | null = null; // Setup Browser name that will be printed out by Karma. this.name = browserDisplayName + ' on SauceLabs (daemon)'; this.on('start', (pageUrl: string) => { daemonConnection = createConnection({port: IPC_PORT}, () => _startBrowserTest(pageUrl, args)); daemonConnection.on('data', (b) => _processMessage(JSON.parse(b.toString()) as BackgroundServiceSendMessages), ); daemonConnection.on('error', (err) => { log.error(err); // Notify karma about the failure. this._done('failure'); }); }); this.on('kill', async (doneFn: () => void) => { _endBrowserTest(); daemonConnection?.end(); doneFn(); }); const _processMessage = (message: BackgroundServiceSendMessages) => { switch (message.type) { case 'browser-not-ready': log.error( 'Browser %s is not ready in the Saucelabs background service.', browserDisplayName, ); this._done('failure'); } }; const _startBrowserTest = (pageUrl: string, browser: Browser) => { log.info('Starting browser %s test in daemon with URL: %s', browserDisplayName, pageUrl); daemonConnection!.write( JSON.stringify(new StartTestMessage(pageUrl, getUniqueId(browser), testSuiteDescription)), ); }; const _endBrowserTest = () => { log.info('Test for browser %s completed', browserDisplayName); daemonConnection!.write(JSON.stringify(new EndTestMessage())); }; }
{ "end_byte": 2645, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/launcher/launcher.ts" }
angular/tools/saucelabs-daemon/launcher/BUILD.bazel_0_559
load("//tools:defaults.bzl", "esbuild", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "launcher", srcs = [ "index.ts", "launcher.ts", ], deps = [ "//tools/saucelabs-daemon", "@npm//@types/node", ], ) # We need a commonjs version of the launcher that can be required from the # root karma-js.conf.js. esbuild( name = "launcher_cjs", entry_point = "index.ts", format = "cjs", output = "index.cjs", platform = "node", deps = [":launcher"], )
{ "end_byte": 559, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/launcher/BUILD.bazel" }
angular/tools/saucelabs-daemon/launcher/index.ts_0_324
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {SaucelabsLauncher} from './launcher'; export default { 'launcher:SauceLabs': ['type', SaucelabsLauncher], };
{ "end_byte": 324, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/launcher/index.ts" }
angular/tools/saucelabs-daemon/background-service/cli.ts_0_1853
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {customLaunchers} from '../../../browser-providers.conf'; import {Browser} from '../browser'; import {SaucelabsDaemon} from './saucelabs-daemon'; const args = process.argv.slice(2); const username = process.env['SAUCE_USERNAME']; const accessKey = process.env['SAUCE_ACCESS_KEY']; const tunnelIdentifier = process.env['SAUCE_TUNNEL_IDENTIFIER']; if (!username || !accessKey) { throw Error('Please set the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` variables.'); } if (!tunnelIdentifier) { throw Error('No tunnel set up. Please set the `SAUCE_TUNNEL_IDENTIFIER` variable.'); } // First argument is the path to the sauce connect binary. This argument is templated into the bazel // binary. if (args.length < 1) { throw Error(`Path to the sauce connect binary expected as first argument`); } const sauceConnect = args[0]; // Second argument is the number of parallel browsers to start. This argument is user supplied and // required. if (args.length != 2) { throw Error(`Please specify the number of parallel browsers to start on the command line.`); } const parallelExecutions = parseInt(args[1]); if (!parallelExecutions) { throw Error(`Please specify a non-zero number of parallel browsers to start.`); } // Start the daemon and launch the given browser const daemon = new SaucelabsDaemon( username, accessKey, process.env['CIRCLE_BUILD_NUM']!, Object.values(customLaunchers) as Browser[], parallelExecutions, sauceConnect, {tunnelIdentifier}, ); if (args.includes('--connect')) { daemon.connectTunnel().catch((err) => { console.error(`Failed to connect to Saucelabs: ${err}`); process.exit(1); }); }
{ "end_byte": 1853, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/cli.ts" }
angular/tools/saucelabs-daemon/background-service/sauce-connect-tunnel.ts_0_1399
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {spawn} from 'node:child_process'; import fs from 'node:fs/promises'; import path from 'node:path'; /** * Establishes the Saucelabs connect tunnel. **/ export async function openSauceConnectTunnel(tunnelIdentifier: string, sauceConnect: string) { console.debug('Starting sauce connect tunnel...'); const tmpFolder = await fs.mkdtemp('saucelabs-daemon-'); await new Promise<void>((resolve, reject) => { // First we need to start the sauce connect tunnel const sauceConnectArgs = [ '--readyfile', `${tmpFolder}/readyfile`, '--pidfile', `${tmpFolder}/pidfile`, '--tunnel-identifier', tunnelIdentifier || path.basename(tmpFolder), ]; const sc = spawn(sauceConnect, sauceConnectArgs); sc.stdout!.on('data', (data) => { if (data.includes('Sauce Connect is up, you may start your tests.')) { resolve(); } }); sc.on('close', (code) => { reject(new Error(`sauce connect closed all stdio with code ${code}`)); }); sc.on('exit', (code) => { reject(new Error(`sauce connect exited with code ${code}`)); }); }); console.debug('Starting sauce connect tunnel established'); }
{ "end_byte": 1399, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/sauce-connect-tunnel.ts" }
angular/tools/saucelabs-daemon/background-service/ipc.ts_0_2749
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {createServer, Server, Socket} from 'net'; import {IPC_PORT} from '../ipc-defaults'; import { BackgroundServiceReceiveMessages, InternalErrorMessage, NoAvailableBrowserMessage, } from '../ipc-messages'; import {SaucelabsDaemon} from './saucelabs-daemon'; let nextSocketId = 0; /** * The IPC server for the Saucelabs background service. This server * listens on the port IPC_PORT for `start-test` and `end-test` messages * from karma tests. These messages are handled and requests are passed * forward to the service SaucelabsDaemon class. */ export class IpcServer { private readonly _server: Server; private _connections = new Map<number, Socket>(); constructor(private _service: SaucelabsDaemon) { this._server = createServer(this._connectionHandler.bind(this)); this._server.listen(IPC_PORT, () => console.info(`Daemon IPC server listening (pid ${process.pid}).`), ); } private _connectionHandler(socket: Socket) { const socketId = nextSocketId++; this._connections.set(socketId, socket); socket.on('data', (b) => { this._processMessage( socket, socketId, JSON.parse(b.toString()) as BackgroundServiceReceiveMessages, ).catch((err) => { console.error(err); this._sendInternalError(socket, err.toString()); }); }); } private async _processMessage( socket: Socket, socketId: number, message: BackgroundServiceReceiveMessages, ) { switch (message.type) { case 'start-test': console.debug(`Requesting test browser: SID#${socketId}: ${message.testDescription}`); const started = await this._service.startTest({ testId: socketId, pageUrl: message.url, requestedBrowserId: message.browserId, }); if (!started) { console.debug(' > Browser not available.'); this._sendUnavailableBrowserMessage(socket); } else { console.debug(' > Browser available. Test can start.'); } break; case 'end-test': console.debug(`Ending tests for SID#${socketId}`); this._service.endTest(socketId); break; default: throw new Error(`Unsupported msg type: ${(message as any).type}`); } } private _sendUnavailableBrowserMessage(socket: Socket) { socket.write(JSON.stringify(new NoAvailableBrowserMessage())); } private _sendInternalError(socket: Socket, msg: string) { socket.write(JSON.stringify(new InternalErrorMessage(msg))); } }
{ "end_byte": 2749, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/ipc.ts" }
angular/tools/saucelabs-daemon/background-service/BUILD.bazel_0_648
load("//tools:defaults.bzl", "nodejs_binary", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "background-service_lib", srcs = glob(["*.ts"]), deps = [ "//:browser-providers", "//tools/saucelabs-daemon", "@npm//@types/node", "@npm//@types/selenium-webdriver4", "@npm//chalk", "@npm//selenium-webdriver4", ], ) nodejs_binary( name = "background-service", data = [ ":background-service_lib", "//:sauce_connect", ], entry_point = ":cli.ts", templated_args = [ "$(rootpath //:sauce_connect)", ], )
{ "end_byte": 648, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/BUILD.bazel" }
angular/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts_0_1396
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import chalk from 'chalk'; import {Builder, WebDriver} from 'selenium-webdriver4'; import {Browser, getUniqueId} from '../browser'; import {IpcServer} from './ipc'; import {openSauceConnectTunnel} from './sauce-connect-tunnel'; const defaultCapabilities = { // TODO: Turn off long-term. Right now this is just for debugging. recordVideo: true, recordScreenshots: false, idleTimeout: 1000, // These represent the maximum values supported by Saucelabs. // See: https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options commandTimeout: 600, maxDuration: 10800, extendedDebugging: true, }; interface RemoteBrowser { id: string; state: 'claimed' | 'free' | 'launching'; driver: WebDriver | null; sessionUrl: string | null; } interface BrowserTest { testId: number; pageUrl: string; requestedBrowserId: string; } /** * The SaucelabsDaemon daemon service class. This class handles the logic of connecting * to the Saucelabs tunnel and provisioning browsers for tests. Provisioned browsers * are re-used for subsequent tests. Their states are tracked so that new test * requests are assigned to browsers that are currently `free` or `launching`. */
{ "end_byte": 1396, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts" }
angular/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts_1397_9560
export class SaucelabsDaemon { /** * Map of browsers and their pending tests. If a browser is acquired on the * remote selenium server, the browser is not immediately ready. If the browser * becomes active, the pending tests will be started. */ private _pendingTests = new Map<RemoteBrowser, BrowserTest>(); /** List of active browsers that are managed by the daemon. */ private _activeBrowsers: RemoteBrowser[] = []; /** Map that contains test ids with their claimed browser. */ private _runningTests = new Map<number, RemoteBrowser>(); private _baseCapabilities; /** Id of the keep alive interval that ensures no remote browsers time out. */ private _keepAliveIntervalId: NodeJS.Timeout | null = null; /* Promise indicating whether we the tunnel is active, or if we are still connecting. */ private _connection: Promise<void> | undefined = undefined; /* Number of parallel executions started */ private _parallelExecutions: number = 0; constructor( private _username: string, private _accessKey: string, private _buildName: string, private _browsers: Browser[], private _maxParallelExecutions: number, private _sauceConnect: string, private _userCapabilities: object = {}, ) { // Starts the keep alive loop for all active browsers, running every 15 seconds. this._keepAliveIntervalId = setInterval(() => this._keepAliveBrowsers(), 15_000); /** Base selenium capabilities that will be added to each browser. */ this._baseCapabilities = {...defaultCapabilities, ...this._userCapabilities}; } /** * Connects the daemon to Saucelabs. * This is typically done when the first test is started so that no connection is made * if all tests are cache hits. */ async connectTunnel() { if (!this._connection) { this._connection = this._connect(); } return this._connection; } /** * Quits all active browsers. */ async quitAllBrowsers() { let quitBrowsers: Promise<void>[] = []; this._activeBrowsers.forEach((b) => { if (b.driver) { quitBrowsers.push(b.driver.quit()); } }); await Promise.all(quitBrowsers); this._activeBrowsers = []; this._runningTests.clear(); this._pendingTests.clear(); } /** * Shutdown the daemon. * * Awaits the shutdown of browsers. */ async shutdown() { await this.quitAllBrowsers(); if (this._keepAliveIntervalId !== null) { clearInterval(this._keepAliveIntervalId); } } /** * End a browser test if it is running. */ endTest(testId: number) { if (!this._runningTests.has(testId)) { return; } const browser = this._runningTests.get(testId)!; browser.state = 'free'; this._runningTests.delete(testId); } /** * Start a test on a remote browser. * * If the daemon has not yet initiated the saucelabs tunnel creation and browser launching then * this initiates that process and awaits until it succeeds or fails. * * If the daemon has already initiated the saucelabs tunnel creation and browser launching * but it is not yet complete then this blocks until that succeeds or fails. * * If all matching browsers are occupied with other tests then test is not run. Promise returns * false. * * If there is a matching browser that are still launching then the test is scheduled to run * on the browser when it is ready. Promise returns true. * * If there is a matching browser that is available the test it started. Promise returns true. */ async startTest(test: BrowserTest): Promise<boolean> { await this.connectTunnel(); if (this._parallelExecutions < this._maxParallelExecutions) { // Start additional browsers on each test start until the max parallel executions are // reached to avoid the race condition of starting a browser and then having another test // start steal it before is claimed by this test. await this.launchBrowserSet(); } const browser = this._findAvailableBrowser(test.requestedBrowserId); if (!browser) { console.error(`No available browser ${test.requestedBrowserId} for test ${test.testId}!`); return false; } if (browser.state == 'launching') { this._pendingTests.set(browser, test); } else { this._startBrowserTest(browser, test); } return true; } /** * @internal * Connects the daemon to Saucelabs. * This is typically done when the first test is started so that no connection is made * if all tests are cache hits. **/ private async _connect() { await openSauceConnectTunnel( (this._userCapabilities as any).tunnelIdentifier, this._sauceConnect, ); } /** * @internal * Launches a set of browsers and increments the count of parallel browser started. If there are * pending tests waiting for a particular browser to launch before they can start, those tests are * started once the browser is launched. **/ private async launchBrowserSet() { this._parallelExecutions++; console.debug( `Launching browsers set ${this._parallelExecutions} of ${this._maxParallelExecutions}...`, ); // Once the tunnel is established we can launch browsers await Promise.all( this._browsers.map(async (browser, id) => { const browserId = getUniqueId(browser); const launched: RemoteBrowser = { state: 'launching', driver: null, sessionUrl: null, id: browserId, }; const browserDescription = `${this._buildName} - ${browser.browserName} - #${id + 1}`; const capabilities: any = { 'browserName': browser.browserName, 'sauce:options': {...this._baseCapabilities, ...browser}, }; // Set `sauce:options` to provide a build name for the remote browser instances. // This helps with debugging. Also ensures the W3C protocol is used. // See. https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options capabilities['sauce:options']['name'] = browserDescription; capabilities['sauce:options']['build'] = browserDescription; console.debug( `Capabilities for ${browser.browserName}:`, JSON.stringify(capabilities, null, 2), ); console.debug(` > Browser-ID: `, browserId); console.debug(` > Browser-Description: `, browserDescription); // Keep track of the launched browser. We do this before it even completed the // launch as we can then handle scheduled tests when the browser is still launching. this._activeBrowsers.push(launched); // See the following link for public API of the selenium server. // https://wiki.saucelabs.com/display/DOCS/Instant+Selenium+Node.js+Tests const driver = await new Builder() .withCapabilities(capabilities) .usingServer( `http://${this._username}:${this._accessKey}@ondemand.saucelabs.com:80/wd/hub`, ) .build(); // Only wait 30 seconds to load a test page. await driver.manage().setTimeouts({pageLoad: 30000}); const sessionId = (await driver.getSession()).getId(); // Mark the browser as available after launch completion. launched.state = 'free'; launched.driver = driver; launched.sessionUrl = `https://saucelabs.com/tests/${sessionId}`; console.info( chalk.yellow( `Started browser ${browser.browserName} on Saucelabs: ${launched.sessionUrl}`, ), ); // If a test has been scheduled before the browser completed launching, run // it now given that the browser is ready now. if (this._pendingTests.has(launched)) { const test = this._pendingTests.get(launched)!; this._pendingTests.delete(launched); this._startBrowserTest(launched, test); } }), ); } /** * @internal * Starts a browser test on a browser. * This sets the browser's state to "claimed" and navigates the browser to the test URL. **/
{ "end_byte": 9560, "start_byte": 1397, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts" }
angular/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts_9563_12175
private _startBrowserTest(browser: RemoteBrowser, test: BrowserTest) { // We're not interested in awaiting on starting the browser test since that would delay // starting additional browsers. Failures in browser test starts are silently ignored in // the daemon. The karma test itself should fail or timeout if there are issues starting // the browser test. (async () => { this._runningTests.set(test.testId, browser); browser.state = 'claimed'; try { console.debug(`Opening test url for #${test.testId}: ${test.pageUrl}`); console.debug(` > Instance URL: ${browser.sessionUrl}`); await browser.driver!.get(test.pageUrl); const pageTitle = await browser.driver!.getTitle(); console.debug(`Test page loaded for #${test.testId}: "${pageTitle}".`); } catch (e) { console.error('Could not start browser test with id', test.testId, test.pageUrl); } })(); } /** * @internal * Given a browserId, returns a browser that matches the browserId and is free * or launching with no pending test. If no such browser if found, returns * null. **/ private _findAvailableBrowser(browserId: string): RemoteBrowser | null { for (const browser of this._activeBrowsers) { // If the browser ID doesn't match, continue searching. if (browser.id !== browserId) { continue; } // If the browser is claimed, continue searching. if (browser.state === 'claimed') { continue; } // If the browser is launching, check if it can be pre-claimed so that // the test starts once the browser is ready. If it's already claimed, // continue searching. if (browser.state === 'launching' && this._pendingTests.has(browser)) { continue; } return browser; } return null; } /** * @internal * Implements a heartbeat for Saucelabs browsers as they could end up not receiving any * commands when the daemon is unused (i.e. Bazel takes a while to start tests). * https://saucelabs.com/blog/selenium-tips-how-to-coordinate-multiple-browsers-in-sauce-ondemand. **/ private async _keepAliveBrowsers() { const pendingCommands: Promise<string>[] = []; this._activeBrowsers.forEach((b) => { if (b.driver !== null) { pendingCommands.push(b.driver.getTitle() as Promise<string>); } }); await Promise.all(pendingCommands); console.debug( `${Date().toLocaleString()}: Refreshed ${pendingCommands.length} browsers (pid ${ process.pid }).`, ); } }
{ "end_byte": 12175, "start_byte": 9563, "url": "https://github.com/angular/angular/blob/main/tools/saucelabs-daemon/background-service/saucelabs-daemon.ts" }
angular/tools/legacy-saucelabs/jit_transform_bundle_main.ts_0_280
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ export {angularJitApplicationTransform} from '../../packages/compiler-cli';
{ "end_byte": 280, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/legacy-saucelabs/jit_transform_bundle_main.ts" }
angular/tools/legacy-saucelabs/pre-setup.ts_0_627
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ // ZoneJS configuration needed for some event manager tests. This config could // affect all legacy tests but in reality is scoped to certain special tests. import {configureZoneUnpatchedEvent} from '../../packages/platform-browser/test/dom/events/zone_event_unpatched.init.mjs'; // Increase the timeout for specs as Saucelabs devices can be slow. jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; configureZoneUnpatchedEvent();
{ "end_byte": 627, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/legacy-saucelabs/pre-setup.ts" }
angular/tools/legacy-saucelabs/build-saucelabs-test-bundle.mjs_0_7196
#!/usr/bin/env node /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import esbuild from 'esbuild'; import fs from 'fs'; import glob from 'fast-glob'; import {dirname, join, isAbsolute, relative} from 'path'; import url from 'url'; import ts from 'typescript'; const containingDir = dirname(url.fileURLToPath(import.meta.url)); const projectDir = join(containingDir, '../../'); const distDir = join(projectDir, 'dist/'); const packagesDir = join(projectDir, 'packages/'); const legacyTsconfigPath = join(packagesDir, 'tsconfig-legacy-saucelabs.json'); const legacyOutputDir = join(distDir, 'legacy-test-out'); const outFile = join(distDir, 'legacy-test-bundle.spec.js'); const jitTransformOutFile = join(distDir, 'legacy-test-jit-transform-bundle.mjs'); /** * This script builds the whole library in `angular/angular` together with its * spec files into a single IIFE bundle. * * The bundle can then be used in the legacy Saucelabs or Browserstack tests. Bundling * helps with avoiding unnecessary complexity with maintaining module resolution at * runtime through e.g. SystemJS, and it increases test stability by serving significantly * less files through the remote browser service tunnels. */ async function main() { await transpileJitTransformTransform(); await compileProjectWithTsc(); const specEntryPointFile = await createEntryPointSpecFile(); const esbuildResolvePlugin = await createResolveEsbuildPlugin(); const result = await esbuild.build({ bundle: true, keepNames: true, treeShaking: false, sourceRoot: projectDir, platform: 'browser', target: 'es2015', format: 'iife', outfile: outFile, sourcemap: true, plugins: [esbuildResolvePlugin], // There are places in the framework where e.g. `window.URL` is leveraged if available, // but with a fallback to the NodeJS `url` module. ESBuild should not error/attempt to // resolve such as the imports for these will not execute in the browser. external: [`${legacyOutputDir}/platform-server/*`, 'url'], stdin: {contents: specEntryPointFile, resolveDir: projectDir}, }); if (result.errors.length) { throw Error('Could not build legacy test bundle. See errors above.'); } } /** * Finds spec files that should be built, bundled and tested as * part of the legacy Saucelabs test job. */ async function findSpecFiles() { const baseDirPattern = glob.convertPathToPattern(legacyOutputDir); const ignore = [ '/_testing_init/**', '/**/e2e_test/**', '/**/*node_only_spec.js', '/benchpress/**', '/compiler-cli/**', '/compiler-cli/src/ngtsc/**', '/compiler-cli/test/compliance/**', '/compiler-cli/test/ngtsc/**', '/compiler/test/aot/**', '/compiler/test/render3/**', '/core/test/bundling/**', '/core/schematics/test/**', '/core/test/render3/ivy/**', '/core/test/render3/jit/**', '/core/test/render3/perf/**', '/elements/schematics/**', '/examples/**/e2e_test/*', '/language-service/**', '/platform-server/**', '/localize/**/test/**', '/localize/schematics/**', '/router/**/test/**', '/zone.js/**/test/**', '/platform-browser/testing/e2e_util.js', ].map((partial) => baseDirPattern + partial); return glob.sync('**/*_spec.js', {absolute: true, cwd: legacyOutputDir, ignore}); } /** * Queries for all spec files in the built output and creates a single * ESM entry-point file which imports all the spec files. * * This spec file can then be used as entry-point for ESBuild in order * to bundle all specs in an IIFE file. */ async function createEntryPointSpecFile() { const testFiles = await findSpecFiles(); let specEntryPointFile = `import './tools/legacy-saucelabs/test-init.ts';`; let i = 0; const testNamespaces = []; for (const file of testFiles) { const relativePath = relative(projectDir, file); const specifier = `./${relativePath.replace(/\\/g, '/')}`; const testNamespace = `__${i++}`; testNamespaces.push(testNamespace); specEntryPointFile += `import * as ${testNamespace} from '${specifier}';\n`; } for (const namespaceId of testNamespaces) { // We generate a side-effect invocation that references the test import. This // is necessary to trick `ESBuild` in preserving the imports. Unfortunately the // test files would be dead-code eliminated otherwise because the specs are part // of folders with `package.json` files setting the `"sideEffects: false"` field. specEntryPointFile += `new Function('x', 'return x')(${namespaceId});\n`; } return specEntryPointFile; } /** * Creates an ESBuild plugin which maps `@angular/<..>` module names to their * locally-built output (for the packages which are built as part of this repo). */ async function createResolveEsbuildPlugin() { const resolveMappings = new Map([ [/@angular\//, `${legacyOutputDir}/`], [/^angular-in-memory-web-api$/, join(legacyOutputDir, 'misc/angular-in-memory-web-api')], [/^zone.js\//, `${legacyOutputDir}/zone.js/`], ]); return { name: 'ng-resolve-esbuild', setup: (build) => { build.onResolve({filter: /(@angular\/|angular-in-memory-web-api|zone.js)/}, async (args) => { const matchedPattern = Array.from(resolveMappings.keys()).find((pattern) => args.path.match(pattern)); if (matchedPattern === undefined) { return undefined; } let resolvedPath = args.path.replace(matchedPattern, resolveMappings.get(matchedPattern)); let stats = await statGraceful(resolvedPath); // If the resolved path points to a directory, resolve the contained `index.js` file if (stats && stats.isDirectory()) { resolvedPath = join(resolvedPath, 'index.js'); stats = await statGraceful(resolvedPath); } // If the resolved path does not exist, check with an explicit JS extension. else if (stats === null) { resolvedPath += '.js'; stats = await statGraceful(resolvedPath); } return stats !== null ? {path: resolvedPath} : undefined; }); }, }; } /** * Creates an ESM bundle for the JIT transform. The JIT transform can then * be used later when we compile the sources and tests. * * Note: This layer of indirection needs to exist as we cannot load TS directly * from an ES module. Running ESBuild first allows us to also transpile the TS fast. */ async function transpileJitTransformTransform() { const result = await esbuild.build({ bundle: true, sourceRoot: projectDir, platform: 'node', target: 'es2020', format: 'esm', outfile: jitTransformOutFile, external: ['typescript'], sourcemap: true, entryPoints: [join(containingDir, 'jit_transform_bundle_main.ts')], }); if (result.errors.length) { throw Error('Could not build JIT transform bundle. See errors above.'); } } /** * Compiles the project using the TypeScript compiler in order to produce * JS output of the packages and tests. */
{ "end_byte": 7196, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/legacy-saucelabs/build-saucelabs-test-bundle.mjs" }
angular/tools/legacy-saucelabs/build-saucelabs-test-bundle.mjs_7197_9526
async function compileProjectWithTsc() { const {angularJitApplicationTransform} = await import(url.pathToFileURL(jitTransformOutFile)); const config = parseTsconfigFile(legacyTsconfigPath, dirname(legacyTsconfigPath)); const program = ts.createProgram(config.fileNames, config.options); const result = program.emit(undefined, undefined, undefined, undefined, { // We need the JIT transform to make ES2015 JIT work and signal inputs. // More details on the ES2015 forwardRef issue: https://github.com/angular/angular/pull/37382. before: [angularJitApplicationTransform(program, /* isCore */ true)], }); const diagnostics = [ ...result.diagnostics, ...program.getSyntacticDiagnostics(), ...program.getSemanticDiagnostics(), ]; if (diagnostics.length) { console.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, { getCanonicalFileName: (fileName) => fileName, getCurrentDirectory: () => program.getCurrentDirectory(), getNewLine: () => '\n', })); throw new Error('Compilation failed. See errors above.'); } console.info('Built packages and specs using TypeScript.'); console.info('The constructor parameters have been downleveled.'); } function parseTsconfigFile(tsconfigPath, basePath) { const {config} = ts.readConfigFile(tsconfigPath, ts.sys.readFile); const parseConfigHost = { useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, fileExists: ts.sys.fileExists, readDirectory: ts.sys.readDirectory, readFile: ts.sys.readFile, }; // Throw if incorrect arguments are passed to this function. Passing relative base paths // results in root directories not being resolved and in later type checking runtime errors. // More details can be found here: https://github.com/microsoft/TypeScript/issues/37731. if (!isAbsolute(basePath)) { throw Error('Unexpected relative base path has been specified.'); } return ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, {}); } /** * Retrieves the `fs.Stats` results for the given path gracefully. * If the file does not exist, returns `null`. */ async function statGraceful(path) { try { return await fs.promises.stat(path); } catch { return null; } } main().catch((e) => { console.error(e); process.exitCode = 1; });
{ "end_byte": 9526, "start_byte": 7197, "url": "https://github.com/angular/angular/blob/main/tools/legacy-saucelabs/build-saucelabs-test-bundle.mjs" }
angular/tools/legacy-saucelabs/test-init.ts_0_266
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import './pre-setup'; import '../testing/browser_tests.init';
{ "end_byte": 266, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/legacy-saucelabs/test-init.ts" }
angular/tools/circular_dependency_test/index.bzl_0_1588
# Copyright Google LLC All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license load("//tools:defaults.bzl", "nodejs_test") MADGE_CONFIG_LABEL = "//tools/circular_dependency_test:madge-resolve.config.js" """ Creates a test target that ensures that no circular dependencies can be found in the given entry point file. """ def circular_dependency_test(name, deps, entry_point, **kwargs): nodejs_test( name = name, data = ["@npm//madge", MADGE_CONFIG_LABEL] + deps, entry_point = "@npm//:node_modules/madge/bin/cli.js", templated_args = [ "--circular", "--no-spinner", # NOTE: We cannot use `$(rootpath)` to resolve labels. This is because `ts_library` # does not pre-declare outputs in the rule. Hence, the outputs cannot be referenced # through labels (i.e. `//packages/core:index.js`). Read more here: # https://docs.bazel.build/versions/2.0.0/skylark/rules.html#outputs # TODO: revisit once https://github.com/bazelbuild/rules_nodejs/issues/1563 is solved. "$$(rlocation %s)" % entry_point, # Madge supports custom module resolution, but expects a configuration file # similar to a Webpack configuration file setting the `resolve` option. "--webpack-config", "$$(rlocation $(rootpath %s))" % MADGE_CONFIG_LABEL, ], testonly = 1, expected_exit_code = 0, **kwargs )
{ "end_byte": 1588, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/circular_dependency_test/index.bzl" }
angular/tools/circular_dependency_test/madge-resolve.config.js_0_1505
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * Custom resolution plugin for Webpack's `resolve-enhanced` package that is used by * Madge for resolving imports. The plugin extends the resolution by leveraging the * runfile resolution and module mappings handled in the module info aspect. */ class BazelRunfileResolutionPlugin { apply(resolver) { resolver.plugin('module', (request, callback) => { try { // Resolve the module through the `require.resolve` method which has been patched // in the Bazel NodeJS loader to respect runfiles and module mappings. This allows // Madge to handle module mappings specified in `ts_library` and `ng_module` targets. const resolvedPath = require.resolve(request.request); // Update the request to refer to the runfile resolved file path. resolver.doResolve('resolve', {...request, request: resolvedPath}, null, callback, true); return; } catch {} // If the file could not be resolved through Bazel's runfile resolution, proceed // with the default module resolvers. callback(); }); } } // Configures a plugin which ensures that Madge can properly resolve specified // dependencies through their configured module names. module.exports = { resolve: {plugins: [new BazelRunfileResolutionPlugin()]}, };
{ "end_byte": 1505, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/circular_dependency_test/madge-resolve.config.js" }
angular/tools/circular_dependency_test/BUILD.bazel_0_43
exports_files(["madge-resolve.config.js"])
{ "end_byte": 43, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/circular_dependency_test/BUILD.bazel" }
angular/tools/symbol-extractor/index.bzl_0_1229
# Copyright Google LLC All Rights Reserved. # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license load("//tools:defaults.bzl", "nodejs_binary", "nodejs_test") """ This test verifies that a set of top level symbols from a javascript file match a gold file. """ def js_expected_symbol_test(name, src, golden, data = [], **kwargs): """This test verifies that a set of top level symbols from a javascript file match a gold file. """ all_data = data + [ Label("//tools/symbol-extractor:lib"), Label("@npm//typescript"), src, golden, ] entry_point = "//tools/symbol-extractor:cli.ts" nodejs_test( name = name, data = all_data, entry_point = entry_point, tags = kwargs.pop("tags", []) + ["symbol_extractor"], templated_args = ["$(rootpath %s)" % src, "$(rootpath %s)" % golden], **kwargs ) nodejs_binary( name = name + ".accept", testonly = True, data = all_data, entry_point = entry_point, templated_args = ["$(rootpath %s)" % src, "$(rootpath %s)" % golden, "--accept"], **kwargs )
{ "end_byte": 1229, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/index.bzl" }
angular/tools/symbol-extractor/run_all_symbols_extractor_tests.js_0_2299
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ // TODO(josephperrott): migrate golden testing to ng-dev toolset const {spawnSync} = require('child_process'); const {Parser: parser} = require('yargs/helpers'); const path = require('path'); // Remove all command line flags from the arguments. const argv = parser(process.argv.slice(2)); // The command the user would like to run, either 'accept' or 'test' const USER_COMMAND = argv._[0]; // The shell command to query for all tests. // Bazel targets for testing goldens process.stdout.write('Gathering all symbol extractor targets'); const ALL_TEST_TARGETS = spawnSync( 'yarn', [ '-s', 'bazel', 'query', '--output', 'label', `'kind(nodejs_test, ...) intersect attr("tags", "symbol_extractor", ...)'`, ], {encoding: 'utf8', shell: true, cwd: path.resolve(__dirname, '../..')}, ) .stdout.trim() .split('\n') .map((line) => line.trim()); process.stdout.clearLine(); process.stdout.cursorTo(0); // Bazel targets for generating goldens const ALL_ACCEPT_TARGETS = ALL_TEST_TARGETS.map((test) => `${test}.accept`); /** Run the provided bazel commands on each provided target individually. */ function runBazelCommandOnTargets(command, targets, present) { for (const target of targets) { process.stdout.write(`${present}: ${target}`); const commandResult = spawnSync('yarn', ['-s', 'bazel', command, target], {encoding: 'utf8'}); process.stdout.clearLine(); process.stdout.cursorTo(0); if (commandResult.status) { console.error(`Failed ${command}: ${target}`); console.group(); console.error(commandResult.stdout || commandResult.stderr); console.groupEnd(); } else { console.info(`Successful ${command}: ${target}`); } } } switch (USER_COMMAND) { case 'accept': runBazelCommandOnTargets('run', ALL_ACCEPT_TARGETS, 'Running'); break; case 'test': runBazelCommandOnTargets('test', ALL_TEST_TARGETS, 'Testing'); break; default: console.warn('Invalid command provided.'); console.warn(); console.warn(`Run this script with either "accept" and "test"`); break; }
{ "end_byte": 2299, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/run_all_symbols_extractor_tests.js" }
angular/tools/symbol-extractor/symbol_extractor_spec.ts_0_2430
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import * as path from 'path'; import {SymbolExtractor} from './symbol_extractor'; describe('scenarios', () => { const symbolExtractorSpecDir = path.dirname( runfiles.resolve('angular/tools/symbol-extractor/symbol_extractor_spec/empty.json'), ); const scenarioFiles = fs.readdirSync(symbolExtractorSpecDir); for (let i = 0; i < scenarioFiles.length; i++) { const filePath = scenarioFiles[i]; // We only consider files as tests if they have a `.js` extension, but do // not resolve to a tsickle externs file (which is a leftover from TS targets). if (!filePath.endsWith('.js') || filePath.endsWith('.externs.js')) { continue; } const testName = filePath.substring(0, filePath.lastIndexOf('.')); const goldenFilePath = path.join(symbolExtractorSpecDir, `${testName}.json`); if (!fs.existsSync(goldenFilePath)) { throw new Error(`No golden file found for test: ${filePath}`); } // Left here so that it is easy to debug single test. // if (testName !== 'hello_world_min_debug') continue; it(testName, () => { const jsFileContent = fs.readFileSync(path.join(symbolExtractorSpecDir, filePath)).toString(); const jsonFileContent = fs.readFileSync(goldenFilePath).toString(); const symbols = SymbolExtractor.parse(testName, jsFileContent); const diff = SymbolExtractor.diff(symbols, jsonFileContent); expect(diff).toEqual({}); }); } // Tests not existing in source root. We cannot glob for generated test fixtures as // tests do not run in a sandbox on Windows. it('should properly capture classes in TypeScript ES2015 class output', () => { const jsFileContent = fs.readFileSync( runfiles.resolve( 'angular/tools/symbol-extractor/symbol_extractor_spec/es2015_class_output.mjs', ), 'utf8', ); const jsonFileContent = fs .readFileSync(path.join(symbolExtractorSpecDir, 'es2015_class_output.json')) .toString(); const symbols = SymbolExtractor.parse('es2015_class_output', jsFileContent); const diff = SymbolExtractor.diff(symbols, jsonFileContent); expect(diff).toEqual({}); }); });
{ "end_byte": 2430, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec.ts" }
angular/tools/symbol-extractor/cli.ts_0_1607
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {runfiles} from '@bazel/runfiles'; import * as fs from 'fs'; import {SymbolExtractor} from './symbol_extractor'; const args = process.argv.slice(2) as [string, string]; process.exitCode = main(args) ? 0 : 1; /** * CLI main method. * * ``` * cli javascriptFilePath.js goldenFilePath.json * ``` */ function main(argv: [string, string, string] | [string, string]): boolean { const javascriptFilePath = runfiles.resolveWorkspaceRelative(argv[0]); const goldenFilePath = runfiles.resolveWorkspaceRelative(argv[1]); const doUpdate = argv[2] == '--accept'; console.info('Input javascript file:', javascriptFilePath); const javascriptContent = fs.readFileSync(javascriptFilePath).toString(); const goldenContent = fs.readFileSync(goldenFilePath).toString(); const symbolExtractor = new SymbolExtractor(javascriptFilePath, javascriptContent); let passed: boolean = false; if (doUpdate) { fs.writeFileSync(goldenFilePath, JSON.stringify(symbolExtractor.actual, undefined, 2)); console.error('Updated gold file:', goldenFilePath); passed = true; } else { passed = symbolExtractor.compareAndPrintError(goldenFilePath, goldenContent); if (!passed) { console.error(`TEST FAILED!`); console.error(` To update the golden file run: `); console.error(` yarn bazel run ${process.env['TEST_TARGET']}.accept`); } } return passed; }
{ "end_byte": 1607, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/cli.ts" }
angular/tools/symbol-extractor/symbol_extractor.ts_0_4591
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import ts from 'typescript'; export interface Symbol { name: string; } export class SymbolExtractor { public actual: Symbol[]; static symbolSort(a: Symbol, b: Symbol): number { return a.name == b.name ? 0 : a.name < b.name ? -1 : 1; } static parse(path: string, contents: string): Symbol[] { const symbols: Symbol[] = []; const source: ts.SourceFile = ts.createSourceFile(path, contents, ts.ScriptTarget.Latest, true); let fnRecurseDepth = 0; function visitor(child: ts.Node) { // Left for easier debugging. // console.log('>>>', ts.SyntaxKind[child.kind]); switch (child.kind) { case ts.SyntaxKind.ArrowFunction: case ts.SyntaxKind.FunctionExpression: fnRecurseDepth++; // Handles IIFE function/arrow expressions. if (fnRecurseDepth <= 1) { ts.forEachChild(child, visitor); } fnRecurseDepth--; break; case ts.SyntaxKind.SourceFile: case ts.SyntaxKind.VariableStatement: case ts.SyntaxKind.VariableDeclarationList: case ts.SyntaxKind.ExpressionStatement: case ts.SyntaxKind.CallExpression: case ts.SyntaxKind.ParenthesizedExpression: case ts.SyntaxKind.Block: case ts.SyntaxKind.PrefixUnaryExpression: ts.forEachChild(child, visitor); break; case ts.SyntaxKind.VariableDeclaration: const varDecl = child as ts.VariableDeclaration; // Terser optimizes variable declarations with `undefined` as initializer // by omitting the initializer completely. We capture such declarations as well. // https://github.com/terser/terser/blob/86ea74d5c12ae51b64468/CHANGELOG.md#v540. if (fnRecurseDepth !== 0) { symbols.push({name: stripSuffix(varDecl.name.getText())}); } break; case ts.SyntaxKind.FunctionDeclaration: const funcDecl = child as ts.FunctionDeclaration; funcDecl.name && symbols.push({name: stripSuffix(funcDecl.name.getText())}); break; case ts.SyntaxKind.ClassDeclaration: const classDecl = child as ts.ClassDeclaration; classDecl.name && symbols.push({name: stripSuffix(classDecl.name.getText())}); break; default: // Left for easier debugging. // console.log('###', ts.SyntaxKind[child.kind], child.getText()); } } visitor(source); symbols.sort(SymbolExtractor.symbolSort); return symbols; } static diff(actual: Symbol[], expected: string | (Symbol | string)[]): {[name: string]: number} { if (typeof expected == 'string') { expected = JSON.parse(expected) as string[]; } const diff: {[name: string]: number} = {}; // All symbols in the golden file start out with a count corresponding to the number of symbols // with that name. Once they are matched with symbols in the actual output, the count should // even out to 0. expected.forEach((nameOrSymbol) => { const symbolName = typeof nameOrSymbol == 'string' ? nameOrSymbol : nameOrSymbol.name; diff[symbolName] = (diff[symbolName] || 0) + 1; }); actual.forEach((s) => { if (diff[s.name] === 1) { delete diff[s.name]; } else { diff[s.name] = (diff[s.name] || 0) - 1; } }); return diff; } constructor( private path: string, private contents: string, ) { this.actual = SymbolExtractor.parse(path, contents); } expect(expectedSymbols: (string | Symbol)[]) { expect(SymbolExtractor.diff(this.actual, expectedSymbols)).toEqual({}); } compareAndPrintError(goldenFilePath: string, expected: string | (Symbol | string)[]): boolean { let passed = true; const diff = SymbolExtractor.diff(this.actual, expected); Object.keys(diff).forEach((key) => { if (passed) { console.error(`Expected symbols in '${this.path}' did not match gold file.`); passed = false; } const missingOrExtra = diff[key] > 0 ? 'extra' : 'missing'; const count = Math.abs(diff[key]); console.error(` Symbol: ${key} => ${count} ${missingOrExtra} in golden file.`); }); return passed; } } function stripSuffix(text: string): string { const index = text.lastIndexOf('$'); return index > -1 ? text.substring(0, index) : text; }
{ "end_byte": 4591, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor.ts" }
angular/tools/symbol-extractor/BUILD.bazel_0_964
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "lib", testonly = True, srcs = glob( ["**/*.ts"], exclude = [ "**/*_spec.ts", "**/*_spec", ], ), deps = [ "//packages:types", "@npm//@bazel/runfiles", "@npm//typescript", ], ) ts_library( name = "test_lib", testonly = 1, srcs = glob( ["**/*_spec.ts"], exclude = ["symbol_extractor_spec/**"], ), deps = [ ":lib", "//packages:types", "@npm//@bazel/runfiles", "@npm//typescript", ], ) jasmine_node_test( name = "test", data = glob(["symbol_extractor_spec/**"]), deps = [ ":test_lib", "//tools/symbol-extractor/symbol_extractor_spec:es2015_class_output", "//tools/symbol-extractor/symbol_extractor_spec:fixtures", ], )
{ "end_byte": 964, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/BUILD.bazel" }
angular/tools/symbol-extractor/symbol_extractor_spec/empty.js_0_226
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ export let __empty__;
{ "end_byte": 226, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/empty.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/var_list.js_0_313
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ !(function () { 'use strict'; var constant = 1, method = function () {}, clazz = class {}; })();
{ "end_byte": 313, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/var_list.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/two_symbols_per_var.js_0_772
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ !(function () { 'use strict'; // tslint:disable-next-line:no-console console.log('Hello, Alice in Wonderland'); var A = (function () { function A() {} return ( (A.prototype.a = function () { return document.a; }), A ); })(), B = (function () { function B() {} return ( (B.prototype.b = function () { return window.b; }), B ); })(); var no_initializer; // tslint:disable-next-line:no-console console.error(new A().a(), new B().b()); })();
{ "end_byte": 772, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/two_symbols_per_var.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/es2015_class_output.ts_0_430
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ class HelloWorld { greet() { console.info('Hello!'); } } // TypeScript generates different output for classes with // static members. class WithStaticMembers extends HelloWorld { static message = 'literal value'; }
{ "end_byte": 430, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/es2015_class_output.ts" }
angular/tools/symbol-extractor/symbol_extractor_spec/simple.js_0_280
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (function () { var Class = function () {}, fn = function () {}; })();
{ "end_byte": 280, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/simple.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/empty_iife.js_0_224
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (function () {})();
{ "end_byte": 224, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/empty_iife.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/iife_arrow_function.js_0_274
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (() => { var Class = function () {}, fn = function () {}; })();
{ "end_byte": 274, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/iife_arrow_function.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js_0_202
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */
{ "end_byte": 202, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js_204_8364
!(function () { 'use strict'; /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ var ChangeDetectionStrategy, ChangeDetectorStatus, ViewEncapsulation; Object; ChangeDetectionStrategy || (ChangeDetectionStrategy = {}); ChangeDetectorStatus || (ChangeDetectorStatus = {}); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ Object; ViewEncapsulation || (ViewEncapsulation = {}); /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ 'undefined' != typeof window && window, 'undefined' != typeof self && 'undefined' != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && self, 'undefined' != typeof global && global; /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ String; /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ Function; var __window$1 = 'undefined' != typeof window && window, __self$1 = 'undefined' != typeof self && 'undefined' != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && self, __global$1 = 'undefined' != typeof global && global, _root = __window$1 || __global$1 || __self$1; !(function () { if (!_root) throw new Error('RxJS could not find any global context (window, self, global)'); })(); Array; !(function () { Object.setPrototypeOf || Array; })(); Error; var RendererStyleFlags2, Symbol$1 = _root.Symbol; 'function' == typeof Symbol$1 && 'function' == typeof Symbol$1.for && Symbol$1.for('rxSubscriber'), (function () { Object.setPrototypeOf || Array; })(); !(function (context) { var $$observable, Symbol = _root.Symbol; if ('function' == typeof Symbol) if (Symbol.observable) $$observable = Symbol.observable; else { $$observable = Symbol('observable'); Symbol.observable = $$observable; } else $$observable = '@@observable'; })(); (function () { Object.setPrototypeOf || Array; })(), (function () { Object.setPrototypeOf || Array; })(); !(function () { Object.setPrototypeOf || Array; })(); (function (root) { var Symbol = root.Symbol; if ('function' == typeof Symbol) { Symbol.iterator || (Symbol.iterator = Symbol('iterator polyfill')); return Symbol.iterator; } var Set_1 = root.Set; if (Set_1 && 'function' == typeof new Set_1()['@@iterator']) return '@@iterator'; var Map_1 = root.Map; if (Map_1) for (var keys = Object.getOwnPropertyNames(Map_1.prototype), i = 0; i < keys.length; ++i) { var key = keys[i]; if ('entries' !== key && 'size' !== key && Map_1.prototype[key] === Map_1.prototype.entries) return key; } })(_root), (function () { Object.setPrototypeOf || Array; })(); (function () { Object.setPrototypeOf || Array; })(), (function () { Object.setPrototypeOf || Array; })(); !(function () { Object.setPrototypeOf || Array; })(); Error, (function () { Object.setPrototypeOf || Array; })(), (function () { Object.setPrototypeOf || Array; })(), (function () { Object.setPrototypeOf || Array; })(); !(function () { Object.setPrototypeOf || Array; })(); Object; RendererStyleFlags2 || (RendererStyleFlags2 = {}); var RendererStyleFlags3, _renderCompCount = 0; function executeHooks(data, allHooks, checkHooks, creationMode) { var hooksToCall = creationMode ? allHooks : checkHooks; null != hooksToCall && (function (data, arr) { for (var i = 0; i < arr.length; i += 2) arr[1 | i].call(data[arr[i]]); })( /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ data, hooksToCall, ); } RendererStyleFlags3 || (RendererStyleFlags3 = {}); var domRendererFactory3 = { createRenderer: function (hostElement, rendererType) { return document; }, }; /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ function getNextLNodeWithProjection(node) { var pNextOrParent = node.pNextOrParent; return pNextOrParent ? (1 == (3 & pNextOrParent.flags) ? null : pNextOrParent) : node.next; } function getNextOrParentSiblingNode(initialNode, rootNode) { for (var node = initialNode, nextNode = getNextLNodeWithProjection(node); node && !nextNode; ) { if ((node = node.pNextOrParent || node.parent) === rootNode) return null; nextNode = node && getNextLNodeWithProjection(node); } return nextNode; } function findFirstRNode(rootNode) { for (var node = rootNode; node; ) { var type = 3 & node.flags, nextNode = null; if (3 === type) return node.native; if (0 === type) { var childContainerData = node.data; nextNode = childContainerData.views.length ? childContainerData.views[0].child : null; } else nextNode = 1 === type ? node.data.head : node.child; node = null === nextNode ? getNextOrParentSiblingNode(node, rootNode) : nextNode; } return null; } function canInsertNativeNode(parent, view) { return 3 == (3 & parent.flags) && (parent.view !== view || null === parent.data); } function stringify$1(value) { return 'function' == typeof value ? value.name || value : 'string' == typeof value ? value : null == value ? '' : '' + value; } /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */
{ "end_byte": 8364, "start_byte": 204, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js_8367_16323
var renderer, rendererFactory, previousOrParentNode, isParent, tData, currentView, currentQueries, creationMode, data, bindingIndex; currentView = createLView(null, null, createTView()); function enterView(newView, host) { var oldView = currentView; data = newView.data; bindingIndex = newView.bindingStartIndex || 0; tData = newView.tView.data; creationMode = newView.creationMode; renderer = newView.renderer; if (null != host) { previousOrParentNode = host; isParent = !0; } currentView = newView; currentQueries = newView.queries; return oldView; } function leaveView(newView) { executeHooks( currentView.data, currentView.tView.viewHooks, currentView.tView.viewCheckHooks, creationMode, ); currentView.creationMode = !1; currentView.lifecycleStage = 1; currentView.tView.firstCreatePass = !1; enterView(newView, null); } function createLView(viewId, renderer, tView, template, context) { void 0 === template && (template = null); void 0 === context && (context = null); return { parent: currentView, id: viewId, node: null, data: [], tView: tView, cleanup: null, renderer: renderer, child: null, tail: null, next: null, bindingStartIndex: null, creationMode: !0, template: template, context: context, dynamicViewCount: 0, lifecycleStage: 1, queries: null, }; } function createLNode(index, type, native, state) { var parent = isParent ? previousOrParentNode : previousOrParentNode && previousOrParentNode.parent, queries = (isParent ? currentQueries : previousOrParentNode && previousOrParentNode.queries) || (parent && parent.queries && parent.queries.child()), isState = null != state, node = { flags: type, native: native, view: currentView, parent: parent, child: null, next: null, nodeInjector: parent ? parent.nodeInjector : null, data: isState ? state : null, queries: queries, tNode: null, pNextOrParent: null, }; 2 == (2 & type) && isState && (state.node = node); if (null != index) { data[index] = node; index >= tData.length ? (tData[index] = null) : (node.tNode = tData[index]); if (isParent) { currentQueries = null; (previousOrParentNode.view !== currentView && 2 != (3 & previousOrParentNode.flags)) || (previousOrParentNode.child = node); } else previousOrParentNode && (previousOrParentNode.next = node); } previousOrParentNode = node; isParent = !0; return node; } function renderEmbeddedTemplate(viewNode, template, context, renderer) { var _isParent = isParent, _previousOrParentNode = previousOrParentNode; try { isParent = !0; previousOrParentNode = null; var cm = !1; if (null == viewNode) { viewNode = createLNode( null, 2, null, createLView(-1, renderer, createTView(), template, context), ); cm = !0; } enterView(viewNode.data, viewNode); template(context, cm); } finally { refreshDynamicChildren(); leaveView(currentView.parent); isParent = _isParent; previousOrParentNode = _previousOrParentNode; } return viewNode; } function renderComponentOrTemplate(node, hostView, componentOrContext, template) { var oldView = enterView(hostView, node); try { rendererFactory.begin && rendererFactory.begin(); template ? template(componentOrContext, creationMode) : (function (directiveIndex, elementIndex) { !(function (currentView, tView, creationMode) { if (1 === currentView.lifecycleStage) { executeHooks(currentView.data, tView.initHooks, tView.checkHooks, creationMode); currentView.lifecycleStage = 2; } })(currentView, currentView.tView, creationMode); !(function (currentView, tView, creationMode) { if (currentView.lifecycleStage < 3) { executeHooks( currentView.data, tView.contentHooks, tView.contentCheckHooks, creationMode, ); currentView.lifecycleStage = 3; } })(currentView, currentView.tView, creationMode); var template = tData[1].template; if (null != template) { var element = data[0], directive = getDirectiveInstance(data[1]), oldView = enterView(element.data, element); try { template(directive, creationMode); } finally { refreshDynamicChildren(); leaveView(oldView); } } })(); } finally { rendererFactory.end && rendererFactory.end(); leaveView(oldView); } } function createTView() { return { data: [], firstCreatePass: !0, initHooks: null, checkHooks: null, contentHooks: null, contentCheckHooks: null, viewHooks: null, viewCheckHooks: null, destroyHooks: null, objectLiterals: null, }; } function locateHostElement(factory, elementOrSelector) { rendererFactory = factory; var defaultRenderer = factory.createRenderer(null, null); return 'string' == typeof elementOrSelector ? defaultRenderer.selectRootElement ? defaultRenderer.selectRootElement(elementOrSelector) : defaultRenderer.querySelector(elementOrSelector) : elementOrSelector; } function refreshDynamicChildren() { for (var current = currentView.child; null !== current; current = current.next) if (0 !== current.dynamicViewCount && current.views) for (var container_1 = current, i = 0; i < container_1.views.length; i++) { var view = container_1.views[i]; renderEmbeddedTemplate(view, view.data.template, view.data.context, renderer); } } var NO_CHANGE = {}; function getDirectiveInstance(instanceOrArray) { return Array.isArray(instanceOrArray) ? instanceOrArray[0] : instanceOrArray; } var EMPTY$1 = {}; function noop$2() {} function invertObject(obj) { if (null == obj) return EMPTY$1; var newObj = {}; for (var minifiedKey in obj) newObj[obj[minifiedKey]] = minifiedKey; return newObj; } /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** *@license *Copyright Google Inc. All Rights Reserved. * *Use of this source code is governed by an MIT-style license that can be *found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ Object; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */
{ "end_byte": 16323, "start_byte": 8367, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js_16326_21699
!( /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (function (componentType, opts) { void 0 === opts && (opts = {}); var component, rendererFactory = opts.rendererFactory || domRendererFactory3, componentDef = componentType.ɵcmp; componentDef.type != componentType && (componentDef.type = componentType); var hostNode = locateHostElement(rendererFactory, opts.host || componentDef.tag), oldView = enterView( createLView( -1, rendererFactory.createRenderer(hostNode, componentDef.rendererType), createTView(), ), null, ); try { !(function (rNode, def) { !(function () { isParent = !1; previousOrParentNode = null; })(); createLNode( 0, 3, rNode, createLView( -1, renderer, (function (template) { return template.ngPrivateData || (template.ngPrivateData = createTView()); })(def.template), ), ); })(hostNode, componentDef); component = getDirectiveInstance( (function (index, directive, directiveDef, queryName) { var instance, flags = previousOrParentNode.flags; 0 == (4092 & flags) ? (flags = 4100 | (3 & flags)) : (flags += 4); previousOrParentNode.flags = flags; Object.defineProperty(directive, '__ngHostLNode__', { enumerable: !1, value: previousOrParentNode, }); data[1] = instance = directive; if (1 >= tData.length) { tData[1] = directiveDef; } var diPublic = directiveDef.diPublic; diPublic && diPublic(directiveDef); var tNode = previousOrParentNode.tNode; tNode && tNode.attrs && (function (instance, inputs, tNode) { var directiveIndex = ((4092 & previousOrParentNode.flags) >> 2) - 1, initialInputData = tNode.initialInputs; (void 0 === initialInputData || directiveIndex >= initialInputData.length) && (initialInputData = (function (directiveIndex, inputs, tNode) { var initialInputData = tNode.initialInputs || (tNode.initialInputs = []); initialInputData[directiveIndex] = null; for (var attrs = tNode.attrs, i = 0; i < attrs.length; i += 2) { var minifiedInputName = inputs[attrs[i]]; void 0 !== minifiedInputName && ( initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []) ).push(minifiedInputName, attrs[1 | i]); } return initialInputData; })(directiveIndex, directiveDef.inputs, tNode)); var initialInputs = initialInputData[directiveIndex]; if (initialInputs) for (var i = 0; i < initialInputs.length; i += 2) instance[initialInputs[i]] = initialInputs[1 | i]; })(instance, 0, tNode); !( /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ (function (index, onInit, doCheck, tView) { if (!0 === tView.firstCreatePass) { null != onInit && (tView.initHooks || (tView.initHooks = [])).push(1, onInit); if (null != doCheck) { (tView.initHooks || (tView.initHooks = [])).push(1, doCheck); (tView.checkHooks || (tView.checkHooks = [])).push(1, doCheck); } } })(0, directiveDef.onInit, directiveDef.doCheck, currentView.tView) ); return instance; })(0, componentDef.n(), componentDef), ); } finally { leaveView(oldView); } opts.features && opts.features.forEach(function (feature) { return feature(component, componentDef); }); !(function (component) { var hostNode = component.__ngHostLNode__; renderComponentOrTemplate(hostNode, hostNode.view, component); })( /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ component, ); })(
{ "end_byte": 21699, "start_byte": 16326, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js_21699_28578
(function () { function HelloWorld() { this.name = 'World'; } HelloWorld.ɵcmp = (function (componentDefinition) { var type = componentDefinition.type, def = { type: type, diPublic: null, n: componentDefinition.factory, tag: componentDefinition.tag || null, template: componentDefinition.template || null, h: componentDefinition.hostBindings || noop$2, inputs: invertObject(componentDefinition.inputs), outputs: invertObject(componentDefinition.outputs), methods: invertObject(componentDefinition.methods), rendererType: (function (type) { if (type && '$$undefined' === type.id) { var isFilled = (null != type.encapsulation && type.encapsulation !== ViewEncapsulation.None) || type.styles.length || Object.keys(type.data).length; type.id = isFilled ? 'c' + _renderCompCount++ : '$$empty'; } type && '$$empty' === type.id && (type = null); return type || null; })(componentDefinition.rendererType) || null, exportAs: componentDefinition.exportAs, onInit: type.prototype.ngOnInit || null, doCheck: type.prototype.ngDoCheck || null, afterContentInit: type.prototype.ngAfterContentInit || null, afterContentChecked: type.prototype.ngAfterContentChecked || null, afterViewInit: type.prototype.ngAfterViewInit || null, afterViewChecked: type.prototype.ngAfterViewChecked || null, onDestroy: type.prototype.ngOnDestroy || null, }, feature = componentDefinition.features; feature && feature.forEach(function (fn) { return fn(def); }); return def; })({ type: HelloWorld, tag: 'hello-world', factory: function () { return new HelloWorld(); }, template: function (ctx, cm) { cm && (function (index, value) { createLNode(0, 3, null); isParent = !1; })(); !(function (index, value) { var existingNode = data[0]; if (existingNode.native) value !== NO_CHANGE && (renderer.setValue ? renderer.setValue(existingNode.native, stringify$1(value)) : (existingNode.native.textContent = stringify$1(value))); else { existingNode.native = renderer.createText ? renderer.createText(stringify$1(value)) : renderer.createTextNode(stringify$1(value)); !(function (node, currentView) { var parent = node.parent; if (canInsertNativeNode(parent, currentView)) { var nativeSibling = (function (node, stopNode) { for (var currentNode = node; currentNode && null !== currentNode; ) { var pNextOrParent = currentNode.pNextOrParent; if (pNextOrParent) { for ( var pNextOrParentType = 3 & pNextOrParent.flags; 1 !== pNextOrParentType; ) { if ((nativeNode = findFirstRNode(pNextOrParent))) return nativeNode; pNextOrParent = pNextOrParent.pNextOrParent; } currentNode = pNextOrParent; } else { for (var currentSibling = currentNode.next; currentSibling; ) { var nativeNode; if ((nativeNode = findFirstRNode(currentSibling))) return nativeNode; currentSibling = currentSibling.next; } var parentNode = currentNode.parent; currentNode = null; if (parentNode) { var parentType = 3 & parentNode.flags; (0 !== parentType && 2 !== parentType) || (currentNode = parentNode); } } } return null; })(node), renderer = currentView.renderer; renderer.listen ? renderer.insertBefore(parent.native, node.native, nativeSibling) : parent.native.insertBefore(node.native, nativeSibling, !1); } })( /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ existingNode, currentView, ); } })( 0, (function (prefix, value, suffix) { return (function (value) { if (creationMode) { !(function () { null == currentView.bindingStartIndex && (bindingIndex = currentView.bindingStartIndex = data.length); })(); return (data[bindingIndex++] = value); } var changed = value !== NO_CHANGE && (function (a, b) { return !(a != a && value != value) && a !== value; })(data[bindingIndex]); changed && (data[bindingIndex] = value); bindingIndex++; return changed ? value : NO_CHANGE; })(value) === NO_CHANGE ? NO_CHANGE : 'Hello ' + stringify$1(value) + '!'; })(0, ctx.name), ); }, }); return HelloWorld; })(), ) ); })();
{ "end_byte": 28578, "start_byte": 21699, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/hello_world_min_debug.js" }
angular/tools/symbol-extractor/symbol_extractor_spec/dont_pick_up_inner_symbols.js_0_360
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ !(function () { function A() { function ignoreA() {} } function B() { let ignoreB = {}; } !function () { let ignoreC = {}; }; })();
{ "end_byte": 360, "start_byte": 0, "url": "https://github.com/angular/angular/blob/main/tools/symbol-extractor/symbol_extractor_spec/dont_pick_up_inner_symbols.js" }