Skip to content

fix(localize): update ng add schematic to support Angular CLI version 15#47763

Closed
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:ng-add-localize-types
Closed

fix(localize): update ng add schematic to support Angular CLI version 15#47763
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:ng-add-localize-types

Conversation

@alan-agius4
Copy link
Contributor

Prior to this, the @angular/localize/init was added as a polyfill which caused the @angular/localize types not to be included in the TypeScript program which caused errors such as the below:

Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.

With the recent changes in the CLI (angular/angular-cli#24032), adding @angular/localize/init as polyfil or in the main.server.ts is no longer necessary. Instead we add this as a TypeScript type. When users are running in JIT mode, we add @angular/localize/init as an additional entrypoint.

This change also exposes the $localize method as a global when importing @angular/localize.

Closes #47677

@alan-agius4 alan-agius4 force-pushed the ng-add-localize-types branch from e8e4bd1 to f0f0b38 Compare October 13, 2022 09:59
@alan-agius4 alan-agius4 added the area: i18n Issues related to localization and internationalization label Oct 13, 2022
@ngbot ngbot bot added this to the Backlog milestone Oct 13, 2022
@alan-agius4 alan-agius4 force-pushed the ng-add-localize-types branch from f0f0b38 to 10801c1 Compare October 13, 2022 10:18
@alan-agius4 alan-agius4 added the target: rc This PR is targeted for the next release-candidate label Oct 13, 2022
@alan-agius4 alan-agius4 force-pushed the ng-add-localize-types branch 2 times, most recently from 0adb742 to 431c079 Compare October 13, 2022 13:23
@alan-agius4 alan-agius4 force-pushed the ng-add-localize-types branch from 431c079 to 6793e84 Compare October 13, 2022 14:10
@alan-agius4 alan-agius4 marked this pull request as ready for review October 13, 2022 14:32
@alan-agius4 alan-agius4 requested review from AndrewKushnir and removed request for dgp1130 October 13, 2022 14:34
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 13, 2022
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

reviewed-for: integration-tests, public-api

Prior to this, the `@angular/localize/init` was added as a polyfill which caused the `@angular/localize` types not to be included in the TypeScript program which caused errors such as the below:

```
Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.
```

With the recent changes in the CLI (angular/angular-cli#24032), adding `@angular/localize/init` as polyfil or in the `main.server.ts` is no longer necessary. Instead we add this as a TypeScript type. When users are running in JIT mode, we add `@angular/localize/init` as an additional entrypoint.

This change also exposes the `$localize` method as a global when importing `@angular/localize`.

Closes angular#47677
@alan-agius4 alan-agius4 force-pushed the ng-add-localize-types branch from 6793e84 to 301a8b5 Compare October 14, 2022 08:33
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Oct 14, 2022
…ze package is installed

The `@angular/localize` entrypoint now exposes the global `$localize` method type.

See: angular/angular#47763
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 14, 2022
@alan-agius4 alan-agius4 removed the request for review from dylhunn October 14, 2022 16:33
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: integration-tests, public-api

@dylhunn
Copy link
Contributor

dylhunn commented Oct 17, 2022

This PR was merged into the repository by commit c9541f4.

@dylhunn dylhunn closed this in c9541f4 Oct 17, 2022
dylhunn pushed a commit that referenced this pull request Oct 17, 2022
… 15 (#47763)

Prior to this, the `@angular/localize/init` was added as a polyfill which caused the `@angular/localize` types not to be included in the TypeScript program which caused errors such as the below:

```
Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.
```

With the recent changes in the CLI (angular/angular-cli#24032), adding `@angular/localize/init` as polyfil or in the `main.server.ts` is no longer necessary. Instead we add this as a TypeScript type. When users are running in JIT mode, we add `@angular/localize/init` as an additional entrypoint.

This change also exposes the `$localize` method as a global when importing `@angular/localize`.

Closes #47677

PR Close #47763
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Oct 21, 2022
…ze package is installed

The `@angular/localize` entrypoint now exposes the global `$localize` method type.

See: angular/angular#47763
clydin pushed a commit to angular/angular-cli that referenced this pull request Oct 21, 2022
…ze package is installed

The `@angular/localize` entrypoint now exposes the global `$localize` method type.

See: angular/angular#47763
clydin pushed a commit to angular/angular-cli that referenced this pull request Oct 21, 2022
…ze package is installed

The `@angular/localize` entrypoint now exposes the global `$localize` method type.

See: angular/angular#47763
(cherry picked from commit b29ae2f)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 17, 2022
@alan-agius4 alan-agius4 deleted the ng-add-localize-types branch September 10, 2025 10:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: i18n Issues related to localization and internationalization target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$localize is not found after ng add with cli v15.0.0-next.4 and ng v15.0.0-next.5

4 participants