18 Commits

Author SHA1 Message Date
Charles Lyding
dcee94b282 refactor(@angular-devkit/build-angular): split Webpack-specific functionality from i18n option creation
The i18n option creation for a project, which is a combination of the `i18n` project field and the `localize`
build option, is now in a separate file from the Webpack specific i18n configuration setup.
This allows the i18n option creation to be used without loading anything Webpack specific.
2024-04-11 13:40:18 -04:00
Charles Lyding
d05eb00161 refactor(@angular-devkit/build-angular): remove direct import of i18n worker code
The i18n inlining worker code was previously imported in several locations to allow
reuse of the options object used to configure the worker. To prevent the worker
code from being used outside of an actual worker, the options object definition is
now located in a separate file and imported in both the worker and any other files
that need to use the inlining options.
2023-01-13 08:29:12 +00:00
Alan Agius
afe9feaa45 fix(@angular-devkit/build-angular): update locale setting snippet to use globalThis.
This commit changes how we set the `LOCALE_ID` when using the `localize` option

- We now include the locale setting snippet only in the main bundle.
- We use `globalThis` to set the the value globally and be accessible across module boundaries. This is important as in some causes such as when using MF `@angular/core` can be located in a bundles others than `main` and `vendor`.
2022-12-09 13:52:28 -08:00
Alan Agius
12931ba8c3 refactor(@angular-devkit/build-angular): remove deprecated ES5 support
Remove deprecated support for ES5 output.

BREAKING CHANGE: Producing ES5 output is no longer possible. This was needed for Internet Explorer which is no longer supported. All browsers that Angular supports work with ES2015+
2022-09-16 11:39:02 -07:00
Charles Lyding
7431d1c256 refactor(@angular-devkit/build-angular): assert catch clause variable type before usage
Prepares the `@angular-devkit/build-angular` package for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
2022-06-14 11:28:21 +02:00
Alan Agius
0d68ed5473 fix(@angular-devkit/build-angular): localized bundle generation fails in watch mode
Previously, we used to delete the temporary emitted JS and map files. However this causes a problem in watch mode, as Webpack will not re-emit these deleted files during the next incremental re-build.

With this change we now delete the entire temporary directory when the process is being terminated instead of a file by file bases.

Closes #22395
2022-01-12 10:05:08 -08:00
Charles Lyding
f44cb908c3 refactor(@angular-devkit/build-angular): eagerly remove used i18n temporary files
Temporary JavaScript application files that have been queued for i18n processing are now removed immediately after reading their content. This reduces the on-disk size of temporary files as well as reduces the needed disk access during the final asset copy phase of the i18n inlining process. Additional debug logging has also been added to the i18n inlining process which can be enabled via the `NG_DEBUG=1` environment variable.
2021-10-19 10:09:10 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
83fab6b494 fix(@angular-devkit/build-angular): improve builder phase reporting 2020-11-02 13:35:52 -06:00
Alan Agius
13b17baebe refactor(@angular-devkit/build-angular): add spinners for localize and downlevelling 2020-09-16 10:38:58 -04:00
Charles Lyding
2ae0300ad5 refactor(@angular-devkit/build-angular): optimize parallel worker shutdown
Stopping the workers can be a potentially lengthy process with a multi-stage approach based on the state of the worker.  This can cause lengthy blocking of the build.  This change allows the shutdown to happen in parallel to the remainder of the build.
2020-05-18 19:30:03 +01:00
Alan Agius
237c1dcf2b build: update jest-worker to version 25.1.0 2020-01-23 15:28:37 -08:00
Charles
862b28f844 fix(@angular-devkit/build-angular): allow localization with development server (#16053)
* fix(@angular-devkit/build-angular): allow localization with development server

* test: ensure i18n application E2E tests are executed
2019-11-08 07:56:05 -08:00
Alan Agius
0686ceff67 fix(@angular-devkit/build-angular): i18n with Ivy in universal builder 2019-10-25 09:52:56 -07:00
Alan Agius
936a9512ae refactor(@angular-devkit/build-angular): move around i18n methods to make them re-usable 2019-10-25 09:52:56 -07:00
Charles Lyding
30536881f9 fix(@angular-devkit/build-angular): set locale identifier when localizing 2019-10-24 12:04:13 -07:00
Charles Lyding
358bc12856 feat(@angular-devkit/build-angular): support i18n localization for non-differential builds 2019-10-21 13:03:32 -07:00