14254 Commits

Author SHA1 Message Date
Angular Robot
cb0c22ee9b build: update all non-major dependencies 2023-11-08 15:04:56 +01:00
cexbrayat
da7dea654f fix(@schematics/angular): use href property binding for links 2023-11-08 15:04:33 +01:00
Charles Lyding
6f9ef1fbb1 fix(@angular-devkit/build-angular): disable Worker wait loop for TS/NG parallel compilation in web containers
When using the `application` builder, a parallel TS/NG compilation is used that is run inside a Node.js Worker.
This Worker by default uses an Atomics-based wait loop to improve performance while waiting for messages. This
loop relies on the synchronous API `receiveMessageOnPort`. While this works well in Node.js, the web container
execution environment does not currently support passing transferable objects via `receiveMessageOnPort`. Attempting
to do so will cause a serialization error and a failed application build. To avoid this problem, the wait loop
optimization is disabled when the web container execution environment is detected. This change is only needed
for the TS/NG compilation as no other parallel operation within the build system currently uses `receiveMessageOnPort`
with transferable objects.
2023-11-08 15:04:20 +01:00
Charles Lyding
36867680c9 Revert "fix(@angular-devkit/build-angular): disable parallel TS/NG compilation inside WebContainers"
This reverts commit 421c175ec94e737081ff7328caddb29de8575acc.
2023-11-08 15:04:20 +01:00
Alan Agius
7dfb94bce0 docs: release notes for the v17.0.0 release 2023-11-08 14:10:36 +01:00
Alan Agius
0ccb4c7d0b build: update Angular packages to version 17 stable
Update all versions to stable
2023-11-08 13:56:40 +01:00
Alan Agius
b5f39c0762 docs: release notes for the v16.2.10 release 2023-11-08 13:11:05 +01:00
Doug Parker
d0bb45eb4b docs: release notes for the v17.0.0-rc.5 release 2023-11-07 14:41:02 -08:00
Alan Agius
e615de7a07 test: add timeout to vite re-use cache
Add timeout to wait for FS to stablize
2023-11-07 20:52:24 +01:00
Charles Lyding
3470bff732 fix(@angular-devkit/build-angular): allow SSR compilation to work with TS allowJs option
When using the `application` builder with SSR enabled and the `allowJs` TypeScript option,
the build would previously generate warnings about undefined imports. This was caused by
the recently introduced initialization error handling that was not accounting for the early
exit of the SSR compiler plugin's `onStart` hook. This early exit prevent the error status
checking from completing which resulted in the SSR plugin load hook assuming an error had
occurred. This in turn caused JavaScript files that were not imported into TypeScript
files to be returned as empty content to avoid the not found error message. To remedy this
situation, the error status is now also set during the SSR early exit.
2023-11-07 20:29:36 +01:00
Alan Agius
a2fa0c995e refactor(@schematics/angular): add fallback fonts
Just in case Inter Tight is not available.
2023-11-07 19:14:34 +01:00
Alan Agius
7e72fd86fa refactor(@schematics/angular): remove unused CSS
Only h1 is used in the initial template.
2023-11-07 19:14:34 +01:00
Alan Agius
be6ef55369 refactor(@schematics/angular): use control flow to reduce code
This commit uses control flow to reduces code in the template
2023-11-07 19:14:34 +01:00
Alan Agius
f9a798be05 fix(@angular/pwa): replace Angular logos
This commit replaces the Angular old logo with the new one.
2023-11-07 19:14:34 +01:00
Alan Agius
1f02aa9f61 fix(@schematics/angular): add missing icons in ng-new template
This commit adds a number of missing icons.

Closes #26257
2023-11-07 19:14:34 +01:00
Angular Robot
d0dcd08490 build: lock file maintenance 2023-11-07 18:11:48 +01:00
akhil biju
31f0286dba fix(@angular-devkit/build-angular): normalize exclude path
fix(@angular-devkit/build-angular): normalize exclude path
2023-11-07 18:11:32 +01:00
Alan Agius
fc40bb580b Revert "test: temporary disable Jest E2E tests"
This reverts commit 5f14bf3441de0ca4f263129eac4a415967eaddd7.
2023-11-07 16:33:34 +01:00
Alan Agius
955d433780 test(@angular-devkit/build-angular): add test to validate vite cache re-usage
This commit adds a test to verify that vite uses the dep optimization cache
2023-11-07 16:33:16 +01:00
Doug Parker
a22d5b8a3b docs: release notes for the v17.0.0-rc.4 release 2023-11-06 17:05:39 -08:00
Doug Parker
42934bcffe feat(@schematics/angular): update ng new generated application 2023-11-06 15:53:53 -08:00
Charles Lyding
f76e1a06df fix(@angular-devkit/build-angular): convert AOT compiler exceptions into diagnostics
When using the `application` builder, exceptions thrown by the AOT compiler will
now be converted into error diagnostics. This allows for more actionable information
to be displayed in the build output. It also prevents the typically incorrect "missing
file" error from occurring in these cases which previously occurred due to TypeScript
files not being emitted as a result of the compiler failure.
2023-11-06 18:53:37 +01:00
Charles Lyding
421c175ec9 fix(@angular-devkit/build-angular): disable parallel TS/NG compilation inside WebContainers
When using the `application` or `browser-esbuild` builders, a parallel TS/NG compilation will
be used by default via a Node.js Worker. However, when used inside a Web Container, the
build will fail to initialize the compilation instance due to what appears to be a defect
within Web containers involving the transfer/serialization of a MessageChannel's MessagePort
objects. To avoid this problem, the parallel compilation is disabled by default when the
build system detects it is being executed from within a Web Container. A parallel compilation
can still be forced by using the `NG_BUILD_PARALLEL_TS=1` environment variable.
2023-11-06 17:51:37 +01:00
Alan Agius
07a8ffd5af fix(@angular-devkit/build-angular): keep dependencies pre-bundling validate between builds
Prior to this commit, the pre-bundling of dependencies was being invalidated for each build. This is because vite uses parts of the config among other things to generate a hash. In our case the config was not always consistent for the same project between different builds.

The main 2 problems areas were:
- Random `root` path
- `include` and `exclude` arrays were not always in the same order.
2023-11-06 16:35:53 +01:00
Alan Agius
7cb5d35a26 fix(@angular-devkit/build-angular): disable dependency optimization for SSR
It appears that Vite currently, has a number of limitation/bugs when using `optimizeDeps` for SSR bundles.

Currently this causes a number of issues:
  - Deps are re-optimized everytime the server is started.
  - Added deps after a rebuild are not optimized.
  - Breaks RxJs (Unless it is added as external). See: #26235

We should follow up with Vite and try to get this solved as this would be a nice feature to use.

Closes #26235 and #26234
2023-11-06 15:20:13 +01:00
Alan Agius
ef2437fe95 refactor(@angular-devkit/build-angular): clean externalMetadata arrays on every rebuild
Currently, externalMetadata arrays get appended the same items over and over again on every rebuild. This commit cleans the array before it appending the new values.
2023-11-06 14:07:56 +01:00
Charles Lyding
988dce6eff refactor(@angular-devkit/build-angular): allow JS transformer result reuse for application dev-server builder
The `JavaScriptTransformer` class that is responsible for Angular linking and several build optimization
transformations can now be configured to track and reuse previous and pending transformation requests.
This allows for cases where multiple consumers of the class will not cause repeat transformation actions.
Pending results will be stored if the constructor option `reuseResults` is enabled. If two transformation
requests are issued for the same file, the same underlying result will be provided to each. This behavior
currently only applies to file transformation requests.
2023-11-06 11:53:39 +01:00
Angular Robot
6ced1f3dad build: update angular 2023-11-05 18:38:34 +01:00
Alan Agius
17399244b3 perf(@angular-devkit/build-angular): start SSR dependencies optimization before the first request
Vite will only start dependency optimization of SSR modules when the first request comes in.

In some cases, this causes a long waiting time. To mitigate this, we call `ssrLoadModule` to initiate this process before the first request.
2023-11-05 18:38:03 +01:00
Alan Agius
64fdb31c78 fix(@angular-devkit/build-angular): exclude node.js built-ins from vite dependency optimization
This fixes the following warnings
```
Cannot optimize dependency: url, present in 'ssr.optimizeDeps.include'
Cannot optimize dependency: path, present in 'ssr.optimizeDeps.include'
```
2023-11-05 13:31:05 +01:00
Charles Lyding
f06a760344 fix(@angular-devkit/build-angular): avoid in-memory prerendering ESM loader errors
The in-memory ESM loader hooks have been adjusted to avoid potential errors when
resolving and loading the bundled server code during prerendering. These errors
could result in hard to diagnose build failures. E2E testing via the deprecated
protractor builder, would silently exit, for instance. To ensure on disk files
including node modules are resolved from the workspace root, a virtual file root
is used for all in memory files. This path does not actually exist but is used to
overlay the in memory files with the actual filesystem for resolution purposes.
A custom URL schema (such as `memory://`) cannot be used for the resolve output
because the in-memory files may use `import.meta.url` in ways that assume a file
URL. `createRequire` from the Node.js `module` builtin is one example of this usage.
2023-11-05 13:30:53 +01:00
Angular Robot
fdee8b799d build: update all non-major dependencies 2023-11-04 11:35:42 +01:00
水上 皓登
fac706047a docs: the node.js's link fix. 2023-11-04 11:35:21 +01:00
Charles Lyding
3b6a999fc1 fix(@angular-devkit/build-angular): ensure secondary Angular compilations are unblocked on start errors
When using the esbuild-based builders (`application`/`browser-esbuild`), the secondary Angular compilations
will wait for the primary compilation to finish prior to bundling. This can potentially occur for polyfills
that contain TypeScript files and the server code if enabled. However, if the Angular compilation throws
an error during the start of the bundling process, the secondary compilations were never notified and instead
would wait indefinitely. To avoid this situation, the compilations will now always be notified at the end of
the compilation which will occur regardless. The build error that will be generated in these situations is
currently not ideal and more verbose than needed but will provide information pertaining to the root cause.
2023-11-03 18:56:37 +01:00
Alan Agius
8c76cb2830 fix(@angular-devkit/build-angular): media files download files in vite
Unlike assets, output file were not prefixed with a `/`. This change alings these and now files are always prefixed with a slash.

Closes #26215
2023-11-03 16:47:01 +01:00
Alan Agius
59908753b6 perf(@angular-devkit/build-angular): optimize server or browser only dependencies once
This commit splits the retrieval of external dependencies into two. Server imports and browser imports. This is so that we avoid vite from optimizing server or browser only dependencies twice.

This also fixes an issue were in some cases Vite would issue a warning like `Cannot optimize dependency: path, present in 'optimizeDeps.include'`. This was caused because of server only dependencies ended up trying to be optimized for a browser build.
2023-11-03 16:06:32 +01:00
Alan Agius
5547095693 refactor: import path methods individually
Minor style change
2023-11-03 15:47:12 +01:00
Alan Agius
98a61ff932 fix(@angular-devkit/build-angular): in vite skip SSR middleware for path with extensions
Do not try to SSR a request that has extensions.

Closes #26199
2023-11-03 15:47:12 +01:00
Angular Robot
1aaed5e4fa build: update angular 2023-11-03 14:51:39 +01:00
Alan Agius
e453695009 refactor(@angular-devkit/build-angular): remove redundant async from render-worker
The `async` keyword is not needed here.
2023-11-03 14:50:55 +01:00
Alan Agius
196e9d9e83 fix(@angular-devkit/build-angular): remove CJS usage warnings for inactionable packages
This commit add `critters` and `express` to the CJS allowed deps.
2023-11-03 14:50:55 +01:00
Alan Agius
0f5fb09852 refactor(@angular/ssr): guard against potential path traversals
This change updates to code to guard against a potential path traversal.

More context about the reasoning behind this change can be found in https://buganizer.corp.google.com/issues/299878755#comment26
2023-11-03 14:50:43 +01:00
Charles Lyding
bcd3a86db8 refactor(@angular-devkit/build-angular): add experimental extension points to Vite-based dev server
When using the experimental programmatic API for the development server with an esbuild-based
builder (`application`/`browser-esbuild`), express compatible middleware can now be added.
Also, the index HTML transformer that previously only worked with the Webpack-based development
server is also now enabled.
However, usage of these options may result in unexpected application output and/or build failures.
They are also not officially supported and SemVer guarantees are not present.
Stable and supported methods for build process extension are being evaluated for a future release.
2023-11-03 13:51:09 +01:00
Alan Agius
5f14bf3441 test: temporary disable Jest E2E tests
More context in https://github.com/angular/angular/pull/52505
2023-11-03 13:49:00 +01:00
Alex Castle
cc055f755e fix(@ngtools/webpack): adjust static scan to find image domains in standlone components
add a new path in the static scan to enable image domain identification to work on standalone components
2023-11-03 13:07:36 +01:00
Alan Agius
7ffc46c70d refactor(@angular-devkit/build-angular): remove __zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION` code
This is now done by default in zone.js versions greater than  `0.14.1`
2023-11-03 13:06:33 +01:00
Charles Lyding
6d8d948ad0 refactor(@angular-devkit/build-angular): cache compiled load ESM file helper
The dynamically compiled ESM import helper is now cached to prevent the need
to recompile the helper function everytime a load ESM helper call is made.
This helper is currently used to workaround dynamic import limitations with
the TypeScript compilation output. Once the build process is updated, it will
no longer be required.
2023-11-03 10:36:27 +01:00
cexbrayat
de1ec9da3b fix(@angular/ssr): enable performance profiler option name 2023-11-03 10:35:19 +01:00
Alan Agius
31d17e0dca test(@angular/cli): delay changes to reduce tests/legacy-cli/e2e/tests/basic/rebuild.ts flakiness
It appears that the changes where being done to quicky to be picked up by the watcher.
2023-11-02 17:12:49 +01:00
Angular Robot
cbe5b3e47f build: update dependency ng-packagr to v17.0.0-rc.1 2023-11-02 16:35:22 +01:00