The dev-infra tooling now directly provides public API change testing capabilities that leverage the `api-extractor` utility. These new testing capabilities are shared with framework and components.
`ts-api-guardian` has been removed as a dependency as a result.
The AOT compiler's internal template type-checking files are not intended to be directly analyzed for diagnostics by the emitting program and are instead analyzed during the template type-checking phase. Previously, only semantic diagnostics were ignored. Now both syntactic and semantic diagnostics are ignored. This change prevents non-actionable diagnostics from being shown during a build.
Addresses: https://github.com/angular/angular/issues/42667
The asset caching for Angular component resources previously required that all assets had an originating file. However, some Webpack plugins may generate assets that do not originate from on-disk files and are instead synthetic. These type of assets are now supported by generating a cache key based on the output name of the asset. These assets will persist within the cache due to the lack of knowledge on the dependencies of these assets which results in the inability to invalidate the assets. Updated assets of the same output name will, however, replace older versions of the asset on rebuilds.
Fixes: #21290
When JIT mode and `directTemplateLoading` were enabled, the plugin would reference the `raw-loader` dependency. This dependency was not mentioned in the `package.json` and is also now deprecated.
An internal `direct-resource` loader is now used instead which removes the usage of the implicit dependency.
The source file for the internal inline resource loader is moved into a `loaders` subdirectory for better code organization. The need to call `require.resolve` is also removed from the consumers of this loader.
`fileDependencies` can contain directories and not just files which can cause incorrect cache invalidation on rebuilds.
Example
```
'/Users/***/tailwindcss-angular12-replica/src/app/component19/component19.component.scss',
'/Users/***/tailwindcss-angular12-replica/tailwind.config.js',
'/var/folders/mp/zsgl3srd389_js72bk4_bkgh0000gn/T/tmp-19814-FDsnpPo5zlQK',
'/Users/***/tailwindcss-angular12-replica/package.json',
'/Users/***/tailwindcss-angular12-replica/src/app/component19',
'/Users/***/tailwindcss-angular12-replica/src/app',
'/Users/***/tailwindcss-angular12-replica/src',
'/Users/***/tailwindcss-angular12-replica',
'/Users/***',
'/Users/****',
'/Users',
'/'
```
Closes#21228
We now encode the data using `encodeURIComponent` which safely encodes `+` signs. Without this a portion of the buffer was lost and caused `Unrecognised input` errors.
Closes#21236
With the support of TypeScript 4.3 within the Angular framework, the CLI now supports using TypeScript 4.3 as well. TypeScript 4.2 also continues to be supported for existing projects.
The Angular Webpack loader will now access the Angular Webpack Plugin's file emitters via the loader context directly. This is instead of using the not fully public Webpack compilation property on the loader context. This change also removes the need to directly alter the Webpack compilation object which previously added an additional property.
The ngcc resolver must be synchronous to integrate with TypeScript which is only synchronous. If the Webpack resolver cache option is enabled when creating a resolver, the resolver will become asynchronous after a rebuild due to the internal implementation of the resolver caching. To prevent this change in behavior, caching is disabled for the ngcc resolver. The ngcc resolver is only used the first time each dependency is used by the application.
Usage of async functions and promises were removed from the TypeScript paths resolver plugin to allow it to be used with both a synchronous and asychronous Webpack resolver.
Webpack 5 provides the Webpack instance as a property on the Webpack compiler which allows Webpack plugins to leverage the same Webpack instance that was used to initiate the build. The `AngularWebpackPlugin` now will only use the provided instance to ensure that differing Webpack instances and/or versions are not used.
By using the Webpack compiler to request a resolver, configuration supplied options will automatically be used (such as symlinks) and also ensures that the same version of the resolver code will be used. Additionally, this removes one of the reasons to directly depend on the `enhanced-resolve` package.
The transform operation types are currently only used and returned by the import elider but are immediately mapped back to the underlying TypeScript node at import elider callsites.
This change also switches the import elider to return a Set to reduce the overhead of repeated array `includes` calls.
This caused Webpack to mark all TypeScript files as removed after the first compilation on Windows because the file separators didn't match
Closes#20891
With this change we update to `webpack` to `5.38.1`, this also updates `webpack-sources` to `2.3.0`, The latter is causing OOM errors on our CI, but it in real projects the memory usage only increased by a small fraction. Also, the OOM errors don't manifest themselves when the entire test suit is run locally.
Therefore with this change we also disable sourcemap genertation for most of the browser builds to speed up the tests and reduce memery usage.
Webpack provides a method to construct a special request string that will remap a loader chain to appear to be from a specific resource path. This requires a custom loader, however, it allows rule matching to leverage the existing file extension based approach and allows providing a path to other loaders which simplifies relative request handling.