3362 Commits

Author SHA1 Message Date
Angular Robot
8515c6bb54 build: update all non-major dependencies 2024-01-29 15:27:28 -08:00
Charles Lyding
dda3d27aff refactor(@angular-devkit/build-angular): remove babel core runtime imports from elide-angular-metadata build optimizer pass
The `elide-angular-metadata` build optimization pass have been cleaned up
and restructured to remove the need for a direct runtime dependency on `@babel/core`.
2024-01-29 15:26:32 -08:00
Charles Lyding
b9ec9ee688 refactor(@angular-devkit/build-angular): remove babel core runtime imports from pure-toplevel-functions build optimizer pass
The `pure-toplevel-functions` build optimization pass have been cleaned up
and restructured to remove the need for a direct runtime dependency on `@babel/core`.
2024-01-29 15:26:17 -08:00
Alan Agius
822e7a482d fix(@angular-devkit/build-angular): handle regular expressions in proxy config when using Vite
This commit enables proxies to have a RegExp as context when using Vite. See: https://vitejs.dev/config/server-options#server-proxy

Closes #26970
2024-01-26 16:46:30 +01:00
Alan Agius
09c6f5f80b refactor(@angular-devkit/build-angular): remove dependency on text-table
Removes `text-table` from dependencies
2024-01-26 16:45:35 +01:00
Alan Agius
dbd3984f24 fix(@angular-devkit/build-angular): correctly handle glob negation in proxy config when using vite
This commit fixes an issue were negated globs in proxy config were not process correctly when using vite.

Closes #26970
2024-01-26 16:21:08 +01:00
Alan Agius
37ffa5e4a0 fix(@angular-devkit/build-angular): resolve absolute output-path when using esbuild based builders
Prior to this change using an absolute path as a `output-path` resulted in the path to be combined with the workspace root instead of resolved which caused the output to be emitted in the incorrect directory or error in Windows.

Closes #26935
2024-01-26 15:39:21 +01:00
Angular Robot
760328c4a1 build: update all non-major dependencies 2024-01-26 08:55:23 +01:00
Alan Agius
bac79d4000 refactor(@angular-devkit/build-angular): increase type safety in bundle-context
Currently the `result` variable will be set to `any` which caused a large part of this file not to be safely typed.
2024-01-25 15:58:10 +01:00
Alan Agius
479b67fedd refactor(@angular-devkit/build-angular): disable SW and index generation during i18n extraction
This commit disables index and service worker generation when using the i18n extraction together with the esbuild builders.
2024-01-25 15:57:57 +01:00
Alan Agius
d6aea27dbc fix(@angular-devkit/build-angular): add required modules as externals imports
Prior to this change any module which was used using `require` was not listed as an external.

Closes #26833
2024-01-25 15:43:23 +01:00
Angular Robot
eadd898e96 build: update all non-major dependencies 2024-01-25 09:35:26 +01:00
Alan Agius
6c65730b60 build: update angular to 17.2.0-next 2024-01-25 09:11:51 +01:00
Alan Agius
8216b11b3c fix(@angular-devkit/build-angular): return 404 for assets that are not found
This commit updates the vite dev-server to return 404 for assets and files that are not found.

Closes #26917
2024-01-24 18:54:25 +01:00
Alan Agius
c93ea15278 fix(@angular-devkit/build-angular): handle handle load event for multiple stylesheets and CSP nonces
The `load` event for each stylesheet may not always be triggered by Google Chrome's handling. Refer to: https://crbug.com/1521256

This results in the media attribute persistently being set to print, leading to distorted styles in the UI. To address this issue, we substitute the onload logic by replacing `link.addEventListener('load', ...` with `document.documentElement.addEventListener('load', ...` and filtering for link tags.

Closes #26932
2024-01-24 14:58:54 +01:00
Charles Lyding
789a5c49b0 refactor(@angular-devkit/build-angular): update Vite client code loading for v5
Vite v5 updated the client code's error dialog text. This requires that the
text replacement code also be updated to remove unactionable information from
the error dialog.
2024-01-24 07:52:36 +01:00
Angular Robot
de042ee80a build: update all non-major dependencies 2024-01-24 07:48:08 +01:00
Alan Agius
1f119be00d fix(@angular-devkit/build-angular): provide actionable error message when server bundle is missing default export
This change improves the error message when the server bundle does not export a default export.

Closes #26922
2024-01-23 16:23:18 +01:00
Angular Robot
248b4c9a75 build: update all non-major dependencies 2024-01-23 10:52:36 +01:00
Charles Lyding
f83a4858d3 fix(@angular-devkit/build-angular): allow package file loader option with Vite prebundling
Previously, the `application` builder would consider all imports originating from a package
to be considered external when caching was enabled. This allows Vite's prebundling to function
and optimize the build/rebuild experience for the development server. However, when using the
newly introduced `loader` option, this also inadvertently caused files that should be affected
by the option that originate from a package to also be considered external. This behavior would
then prevent the loader customization from being performed. To rectify this situation, all files
that would be affected by a loader customization will not be marked as external for the purposes
of prebundling unless explicitly configured by the `externalDependencies` option.
2024-01-23 10:52:12 +01:00
Alan Agius
0b0df5a761 fix(@angular-devkit/build-angular): pre-transform error when using vite with SSR
This commit fixes a regression which causes a pre-transform error when using vite with ssr. The `request.url` is now passed to the index transformer instead of `request.originalUrl`. This is because the `request.url` will have a value of the `index.html`.

Closes #26897
2024-01-22 16:05:06 +01:00
Alan Agius
14b1be26b9 refactor(@angular-devkit/build-angular): use for loop instead of filter and forEach
Reduce iterations by using a `for loop`.
2024-01-22 15:56:44 +01:00
Alan Agius
af1f0da37f fix(@angular-devkit/build-angular): do not add internal CSS resources files in watch
This change fixes an issue which caused internal virtual inputs to be added to the watch, this cases watchpack to emit a removed event as this file does not exist on disk.

We fix this issue, by prefixing `css-resouces` namespace with `angular:` which the input to be filtered out, see: 4539961968/packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts (L251)

Closes #26918
2024-01-22 15:56:32 +01:00
Alan Agius
f844e98c0e fix(@angular-devkit/build-angular): ENOENT: no such file or directory on Windows during component rebuild
Previously, we `joined` the workspace root with the `outputFile.path`, in windows this caused a problem as during the 2nd rebuild it caused the workspace root to be prepended again which causes a `ENOENT` error. To avoid this problem, now we `clone` the output file.

Closes #26900
2024-01-22 15:56:19 +01:00
Angular Robot
4539961968 build: update all non-major dependencies 2024-01-22 13:28:04 +01:00
Charles Lyding
ebe3afb15b refactor(@angular-devkit/build-angular): move Angular memory Vite plugin into separate file
To reduce the amount of code within the main Vite development server file, the Vite plugin
that handles the in-memory output file integration for the Angular build system is now within
a separate file.
2024-01-22 13:27:37 +01:00
Angular Robot
fffc9e1f7e build: update dependency vite to v5.0.12 [security] 2024-01-19 22:35:53 -05:00
Angular Robot
8eab5aa912 build: update all non-major dependencies 2024-01-18 09:58:07 -05:00
Angular Robot
9c15470511 build: update dependency postcss-loader to v8 2024-01-17 08:46:53 -05:00
Alan Agius
771fdcdc1d fix(@angular-devkit/build-angular): alllow OPTIONS requests to be proxied when using vite
This commit fixes an issue were `OPTIONS` requests were not being proxied when using Vite dev-server

Closes #26782
2024-01-16 14:28:33 +01:00
Charles Lyding
7d1cff0276 refactor(@angular-devkit/build-angular): allow internal Angular compilation control of diagnostic modes
To support generate diagnostics in varying ways, the internal compilation classes
now support a `modes` argument when diagnosing files during a build using the `application` builder.
This is not exposed as an option at this time but can be experimented with a build using the
`NG_BUILD_TYPE_CHECK` environment variable. This environment variable is not considered part of the
public API and may be removed or altered in the future. Its current purpose is to allow profiling
of the type checking diagnostics functionality of the build system.
2024-01-16 08:21:15 -05:00
Angular Robot
898b7504eb build: update dependency sass-loader to v14 2024-01-16 08:20:41 -05:00
Doug Parker
ca431712b2 refactor: add node: prefix to imports of Jest builder 2024-01-16 08:20:01 -05:00
Angular Robot
5fdfa5561d build: update all non-major dependencies 2024-01-16 08:18:45 -05:00
Angular Robot
2b161f2ddc build: update dependency source-map-loader to v5 2024-01-16 09:10:08 +01:00
Charles Lyding
8f47f1e965 feat(@angular-devkit/build-angular): provide default and abbreviated build target support for dev-server and extract-i18n
The `buildTarget` options for both the `dev-server` and `extract-i8n` builders
now have default values that reflect the recommended and new project generated
values. The defaults are as follows where `<current-project>` is the name of the project
where the `dev-server` or `extract-i18n` builder target is located:
* `dev-server` --> `<current-project>:build:development`
* `extract-i18n` --> `<current-project>:build`

Additionally, abbreviated target specifiers are now supported for these
options. This allows target specifiers such as `::production` which would expand
to `<current-project>:build:production` for either builder.
Abbreviated target specifiers are only supported for the `buildTarget` option in
the `dev-server` and `extract-i18n` builders.
2024-01-12 10:58:29 -08:00
Angular Robot
6e691230f0 build: update dependency copy-webpack-plugin to v12 2024-01-11 10:50:23 -08:00
Angular Robot
4b26211ea6 build: update all non-major dependencies 2024-01-11 10:50:09 -08:00
Alan Agius
c49f9abe85 Revert "build: update dependency webpack-dev-middleware to v7" 2024-01-09 19:20:23 +01:00
Angular Robot
7a91323189 build: update all non-major dependencies 2024-01-09 09:42:06 -08:00
Charles Lyding
18a11f503c refactor(@angular-devkit/build-angular): add experimental builder selector extension for dev-server
When using the experimental programmatic API for the development server, the choice of builder used
to execute the actual underlying build can now be chosen via a selector function extension option.
The returned string value must be one of the first-party esbuild-based builders for the Vite-based
development server to be used. All other returned values will cause the Webpack-based development
server to be used. The Vite-based development server currently requires one of those builders to
be used (either `@angular-devkit/build-angular:application` or `@angular-devkit/build-angular:browser-esbuild`).
2024-01-09 09:41:40 -08:00
Angular Robot
cd78e03500 build: update dependency webpack-dev-middleware to v7 2024-01-08 16:33:58 -08:00
Charles Lyding
b18bd20bc8 refactor(@angular-devkit/build-angular): move diagnostic logging out of build execution
The logging of diagnostic (error/warning) messages from the build execution within the
`application` builder has been moved up one level. This allows the actual execution to
focus more on generating a result and leaves the enclosing builder system to handle
notification of the results.
2024-01-08 16:33:39 -08:00
Charles Lyding
2d260eae7c refactor(@angular-devkit/build-angular): move bundler context setup into separate file
To reduce the amount of code within the main `application` builder execution function,
the bundler context setup has been moved into a separate file. This also reduces the
amount of imports within the main execution function's module.
2024-01-08 16:33:39 -08:00
Leosvel Pérez Espinosa
8d56365e7e fix(@angular-devkit/build-angular): fix normalization of the application builder extensions 2024-01-08 16:33:18 -08:00
Charles Lyding
481358618b fix(@angular-devkit/build-angular): show diagnostic messages after build stats
To improve the readability and discoverability of any warnings or errors present
during build, the diagnostic messages will be shown after the build stats are
displayed. For large projects the amount of generated files previously could cause
warnings to scroll off the screen and potentially be missed.
2024-01-05 10:47:50 +01:00
Angular Robot
2ead55d7db build: update all non-major dependencies 2024-01-05 10:38:14 +01:00
Doug Parker
4f53e0f4d8 refactor: remove process.cwd from Web Test Runner builder
Turns out this isn't needed for `application` builder to correctly resolve inputs. Not using `process.cwd` should make this builder a little less brittle for monorepo use cases or when running `ng test` inside a subdirectory.
2024-01-04 14:11:46 +01:00
Angular Robot
3451e9da7c build: update dependency @web/test-runner to ^0.18.0 2024-01-04 11:00:25 +01:00
Doug Parker
bdd4f2c5d8 refactor: log warnings for unsupported options in Web Test Runner
This helps notify users when they are attempting to use an option from Karma which hasn't been implemented yet.
2024-01-03 18:52:58 +01:00