angular-cn/packages/common
Terence D. Honles 078b0be4dc fix(common): `locales/global/*.js` are not ES5 compliant (#36342)
Although this code has been part of Angular 9.x I only noticed this
error when upgrading to Angular 9.1.x because historically the source
locale data was not injected when localizing, but as of
angular/angular-cli#16394 (9.1.0) it is now included. This tipped me off
that my other bundles were not being built properly, and this change
allows me to build a valid ES5 bundle (I have also added a verification
step to my build pipeline to alert me if this error appears again in any
of my bundles).

I found the `locales/global/*.js` file paths being referenced by the
`I18nOptions` in
@angular-devkit/build-angular/src/utils/i18n-options.ts,
and following that it looks like it is actually loaded and used in
@angular-devkit/build-angular/src/utils/process-bundle.ts. I saw the
function `terserMangle` does appear that it is likely aware of the build
being ES5, but I'm not sure why this is not producing a valid ES5
bundle.

This change updates `tools/gulp-tasks/cldr/extract.js` to produce ES5
compliant `locales/global/*.js` and that fixes my issue. However, I am
not sure if @angular-devkit/build-angular should be modified to produce
a valid ES5 bundle instead or if the files could be TypeScript rather
than JavaScript files.

A test that a valid ES5 bundle is produced would be helpful, and I hope
this is reproducible and not some issue with my config.

PR Close #36342
2020-04-09 11:30:32 -07:00
..
http fix(zone.js): add issue numbers of `@types/jasmine` to the test cases (#34625) 2020-04-08 12:10:34 -07:00
locales fix(common): `locales/global/*.js` are not ES5 compliant (#36342) 2020-04-09 11:30:32 -07:00
src fix(common): let `KeyValuePipe` accept type unions with `null` (#36093) 2020-03-24 14:41:41 -07:00
test fix(common): let `KeyValuePipe` accept type unions with `null` (#36093) 2020-03-24 14:41:41 -07:00
testing docs: add api doc to sub-packages (#33801) 2019-11-20 14:48:50 -08:00
upgrade feat(core): add `isPromise` generic (#34168) 2020-03-20 10:15:01 -07:00
BUILD.bazel build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
PACKAGE.md docs: add api doc to sub-packages (#33801) 2019-11-20 14:48:50 -08:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json build(packaging): add repository.directory field to package.jsons (#27544) 2020-02-25 13:12:45 -08:00
public_api.ts refactor(common): move the low level locale registering to core (#33523) 2019-11-05 17:26:59 +00:00