3589 Commits

Author SHA1 Message Date
Charles Lyding
6b544f70e7 fix(@angular/build): support reading on-disk files during i18n extraction
If an application has JavaScript files that are sourced directly from disk,
the extraction would previously fail due to the i18n extractor only able
to access the in-memory generated JavaScript files. The extractor can now
access both memory and disk-based JavaScript files.
2024-08-20 17:05:27 +02:00
Angular Robot
4d19d7c1ea build: update all non-major dependencies 2024-08-20 14:11:36 +02:00
Angular Robot
212034bab3 build: update all non-major dependencies 2024-08-19 13:24:50 +02:00
Alan Agius
71c06c69f6 fix(@angular/build): improve error message when an unhandled exception occurs during prerendering
This change enhances the error messaging when an unhandled exception occurs during the prerendering process. The updated error message provides more context and clarity.

**Previous Behavior**

```
ng b
An unhandled exception occurred: Some error!!!
See "/tmp/ng-S2ABKF/angular-errors.log" for further details.
```

**Updated Behavior:**
```
ng b
Browser bundles
Initial chunk files     | Names               |  Raw size | Estimated transfer size
main-AFPIPGGK.js        | main                | 218.00 kB |                59.48 kB
polyfills-Z2GOM3BN.js   | polyfills           |  35.82 kB |                11.80 kB
styles-5INURTSO.css     | styles              |   0 bytes |                 0 bytes

                        | Initial total       | 253.82 kB |                71.28 kB

Server bundles
Initial chunk files     | Names               |  Raw size
server.mjs              | server              |   1.11 MB |
chunk-HZL5H5M5.mjs      | -                   | 526.77 kB |
polyfills.server.mjs    | polyfills.server    | 269.91 kB |
chunk-GFWAPST7.mjs      | -                   |  19.16 kB |
chunk-5XUXGTUW.mjs      | -                   |   2.55 kB |
render-utils.server.mjs | render-utils.server |   1.46 kB |
main.server.mjs         | main.server         | 149 bytes |

Lazy chunk files        | Names               |  Raw size
chunk-7YC4RJ5P.mjs      | xhr2                |  12.08 kB |

Prerendered 1 static route.
Application bundle generation failed. [4.923 seconds]

✘ [ERROR] An error occurred while prerendering route '/'.

Error: Some error!!!
    at render (node_modules/@angular/build/src/utils/server-rendering/render-worker.js:20:20)
    at /angular-cli/abc/node_modules/piscina/dist/worker.js:146:32
```

Closes #28212
2024-08-15 15:52:31 +02:00
Charles Lyding
618fdea00b build: update Angular versions to 19.0.0-next.0 2024-08-14 16:15:35 -04:00
Alan Agius
474571f087 build: remove Bazel typings workaround
The workaround is no longer necessary since the bug has been resolved upstream.
2024-08-14 19:12:27 +02:00
Angular Robot
91b561d652 build: update dependency watchpack to v2.4.2 2024-08-14 17:04:47 +02:00
Alan Agius
e9b057b39d refactor(@angular/build): remove route extractor and use version from @angular/ssr
Removed the route extractor from `@angular/build` and replaced it with the one from `@angular/ssr` for consistency and improved maintenance.
2024-08-14 16:42:24 +02:00
Charles Lyding
7af63b4aba refactor(@angular-devkit/build-angular): reduce custom code in browser-esbuild implementation
The implementation of the `browser-esbuild` builder is now a small wrapper around the
`application` builder. The custom file writing code is no longer required with the availability
of the additional output path options for `application` builder. This also allows the internal
`browser-esbuild` programmatic interface to retain its architect-based signature.
2024-08-13 07:54:24 -04:00
Angular Robot
8d650d308e build: update all non-major dependencies 2024-08-13 11:36:04 +02:00
Angular Robot
289ea4cad2 build: update all non-major dependencies 2024-08-12 13:53:07 -04:00
Angular Robot
3e1f952536 build: update all non-major dependencies 2024-08-07 11:00:03 -04:00
Charles Lyding
42438302d8 refactor(@angular/build): avoid write file logic for internal application build action
The internal "buildApplicationInternal" function is only used by several consumers that
require writing the output files to disk. One, `browser-esbuild`, directly writes
to the disk. The two experimental unit test builders also have unique requirements
and also directly write. This leaves only the main `application` builder that relies on the
internal file writing functionality of `buildApplicationInternal`. To avoid unneeded
logic for the other usages (`dev-server`, `extract-i18n`, unit testing, etc.), the
disk writing logic is now elevated to the `application` build itself. The internal
function will now always provide the output files within the result objects generated
from a successful build. This also removes the need for the other usages to specify
that files should not be written to disk.
2024-08-06 08:23:18 -04:00
Angular Robot
349e052f41 build: update all non-major dependencies 2024-08-05 15:43:13 -04:00
Charles Lyding
bb802d14eb refactor(@angular-devkit/build-angular): only write test related files in Jest builder
With the structured build results available, the Jest builder can now more
easily write only the needed files to a temporary location. This reduces
the need to assume build directory output structure and reduces the amount
of potential filesystem calls. The temporary files are also now written
into a UUID subdirectory within the existing `dist/test-out` location.
This allows for multiple projects to be tested concurrently without
overwriting each other.
2024-08-05 13:46:42 -04:00
Charles Lyding
24be1e7ff8 refactor(@angular-devkit/build-angular): only write test related files in WTR builder
With the structured build results available, the WTR builder can now more
easily write only the needed files to a temporary location. This reduces
the need to assume build directory output structure and reduces the amount
of potential filesystem calls. The temporary files are also now written
into a UUID subdirectory within the existing `dist/test-out` location.
This allows for multiple projects to be tested concurrently without
overwriting each other.
2024-08-05 13:46:42 -04:00
Angular Robot
2bf8e7f296 build: update all non-major dependencies 2024-07-30 12:40:39 +02:00
Angular Robot
22938486c5 build: update all non-major dependencies 2024-07-29 14:39:15 +02:00
Alan Agius
0466fb74a2 fix(@angular/build): resolve error with extract-i18n builder for libraries
The `extract-i18n` builder is only intended to be used with application projects.

Closes #28109
2024-07-29 09:06:42 +02:00
Angular Robot
5091430c19 build: update dependency sass-loader to v16 2024-07-29 08:55:24 +02:00
Angular Robot
790835162c build: update all non-major dependencies 2024-07-25 09:42:23 -07:00
Angular Robot
a131c9bec9 build: update dependency sass-loader to v15 2024-07-24 09:05:56 -07:00
Angular Robot
94b331e667 build: update all non-major dependencies 2024-07-22 12:53:59 -07:00
Charles Lyding
421b6e75b4 refactor(@angular/build): provide structured application builder result types
The application builder now provides structured output types to its internal
consumers. The architect builders themselves and the programmatic API is
not changed. These output result types allow for the development server to
receive additional information regarding the build and update the active
browser appropriately. This functionality is not yet implemented but the
additional result types provide the base infrastructure to enable future
features. The result types also allow for reduced complexity inside other
builders such as i18n extraction and the browser compatibility builder.
The usage is not yet fully optimized and will be refined in future changes.
2024-07-19 10:08:38 -04:00
Angular Robot
64b50815e1 build: update all non-major dependencies 2024-07-18 10:04:45 -07:00
Angular Robot
e21e9867f0 build: update all non-major dependencies 2024-07-17 09:34:41 -07:00
Angular Robot
346ad54a58 build: update all non-major dependencies 2024-07-15 09:29:51 -07:00
Angular Robot
81a3563b6f build: update all non-major dependencies 2024-07-12 11:19:35 +02:00
Angular Robot
ba13d03176 build: update dependency terser to v5.31.2 2024-07-11 13:24:05 +02:00
Charles Lyding
5895e9fb01 test: enable no-case-declarations lint rule
The `no-case-declarations` rule is now enabled and all failures
in have been addressed within the published code. Unit tests
have been excluded.
2024-07-11 08:19:56 +02:00
Charles Lyding
eced3a8ecc test: enable no-fallthrough lint rule
The `no-fallthrough` rule is now enabled and all failures
have been addressed within the code.
2024-07-11 08:19:56 +02:00
Alan Agius
01c1ec087e build: update Angular dependencies to version 18.2.0-next.0 2024-07-10 16:00:13 +02:00
Angular Robot
22d9369aef build: update all non-major dependencies 2024-07-10 09:07:48 +02:00
Charles Lyding
4286bb03b5 refactor(@angular/build): remove direct usage of undici dependency for SSR
The Node.js types (`@types/node`) now contains the information for the `Response`
class and the global `fetch` function. The `Response` object is also globally
accessible in all versions of Node.js supported by the Angular CLI. This removes
the need to depend directly on the `undici` package.
The `undici` package is still used for unit-testing and remains as a development
dependency.
2024-07-08 18:54:18 +02:00
Angular Robot
b0b39b30d3 build: update all non-major dependencies 2024-07-03 09:27:02 -04:00
Charles Lyding
d449c9d093 build: update @discovery/json-ext to v0.6.0 2024-07-02 10:13:04 -04:00
Angular Robot
394e761a5b build: update dependency webpack-merge to v6 2024-07-02 09:33:08 -04:00
Alan Agius
f49c8d3b0a fix(@angular-devkit/build-angular): rollback terser to 5.29.2
More information in https://github.com/terser/terser/issues/1539

Closes #27866
2024-07-02 15:11:07 +02:00
Alan Agius
164c0d805d fix(@angular-devkit/build-angular): reduce the number of max workers to available CPUs minus one
This commit reduces the maximum number of workers to the available CPUs minus 1. This adjustment ensures that some resources are left for the main thread, preventing it from being starved of CPU cycles.
2024-07-01 15:11:59 +02:00
Alan Agius
f16fbd82ad build: update all non-major dependencies 2024-07-01 13:44:11 +02:00
Angular Robot
9c26db46d7 build: update dependency https-proxy-agent to v7.0.5 2024-06-28 11:38:05 -07:00
Angular Robot
7c4e0918d9 build: update all non-major dependencies 2024-06-27 10:09:22 -07:00
Angular Robot
169daf1a2e build: update dependency piscina to v4.6.1 2024-06-26 08:31:48 -07:00
Charles Lyding
d56c8de284 refactor: minor code cleanup to improve code health
Several smaller code changes to improve type information and remove now
unneeded code structures based on improvements to both Node.js, TypeScript,
and underlying dependencies.
2024-06-25 16:57:16 -04:00
Charles Lyding
fa9bce0e9a test: enable @typescript-eslint/no-unnecessary-type-assertion lint rule
The `@typescript-eslint/no-unnecessary-type-assertion` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04:00
Charles Lyding
741cf7fe1e test: enable @typescript-eslint/await-thenable lint rule
The `@typescript-eslint/await-thenable` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04:00
Alan Agius
0d2d9860fd build: remove @types/browserslist
`browserslist` now ships it's own typings
2024-06-25 21:20:26 +02:00
Alan Agius
aebfde28c7 build: update all non-major dependencies
Closes #27881
2024-06-25 20:53:49 +02:00
Charles Lyding
17e168379e build: additional fixes for tsetse rule compliance
Due to bazel rules_nodejs caching, several additional `JSON.parse` usages were not
caught in the first set of fixes. These have now been addressed. Also,
the `must-use-promises` rule has been patched to match the behavior of the
`@typescript-eslint/no-floating-promises` for consistency.
The bazel option `suppressTsconfigOverrideWarnings` was also removed from the
`tsconfig` as it is a no-op and was previously used for now removed feature.
Test files are currently excluded from the `JSON.parse` rule to avoid large
changes to test code.
2024-06-25 11:17:33 -04:00
Charles Lyding
39f946a848 build: enabled isolated modules TypeScript option
The TypeScript `isolatedModules` option is now enabled for all TypeScript
code within the repository. As a result, all packages will now be built
with the option enabled. This does not affect projects created with the CLI
and is only related to the building of the actual Angular CLI code.
The `isolatedModules` option ensures that code can be emitted without the
TypeScript typechecker and allows tools other than TypeScript to potentially
be used. Code was updated to correct all errors after the option was enabled.
Additionally, some early code fixes were done to add function and accessor
return types to prepare for future `isolatedDeclarations` usage. More changes
would be needed to consider turning on `isolatedDeclarations`, however.
2024-06-23 15:34:49 +02:00