Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

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

@ngbot ngbot bot added this to the Backlog milestone Oct 13, 2022
@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 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 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)
nouraellm pushed a commit to nouraellm/angular that referenced this pull request Nov 6, 2022
… 15 (angular#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 angular#47677

PR Close angular#47763
@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
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 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