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

feat(ivy): support ng-add in localize package #32791

Closed
wants to merge 1 commit into from
Closed

feat(ivy): support ng-add in localize package #32791

wants to merge 1 commit into from

Conversation

filipesilva
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the new behavior?

The @angular/localize package can by added to an Angular CLI project via ng add.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@mary-poppins
Copy link

You can preview 90debce at https://pr32791-90debce.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 39abc30 at https://pr32791-39abc30.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 8753f5d at https://pr32791-8753f5d.ngbuilds.io/.

@mary-poppins
Copy link

You can preview f4ac0cc at https://pr32791-f4ac0cc.ngbuilds.io/.

@filipesilva filipesilva added the target: major This PR is targeted for the next major release label Sep 20, 2019
@filipesilva filipesilva marked this pull request as ready for review September 20, 2019 18:16
@filipesilva filipesilva requested review from a team as code owners September 20, 2019 18:16
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Thanks for getting on with this @filipesilva .
The schematic itself looks good to me.
I am concerned about the extra dependencies and I think we need a README file to explain what this schematic is doing and why.

packages/localize/package.json Outdated Show resolved Hide resolved
packages/localize/schematics/ng-add/index.ts Outdated Show resolved Hide resolved
packages/localize/schematics/ng-add/schema.json Outdated Show resolved Hide resolved


// Object.values() is the right way of doing this but it is only available with the ES2017
// TS lib and is not downleveled.
Copy link
Member

Choose a reason for hiding this comment

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

What versions of node do we have to support?
Object.values has been available since node.js v7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only Node 10 and above on the CLI side of things, which is the main consumer for ng-add. Is it ok to add compilation units with custom tsconfigs here though? None of the other packages seem to do it.

Copy link
Member

Choose a reason for hiding this comment

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

I think it makes sense to target the node version of the consuming code (CLI in this case). You could view the schematic as a specialized secondary entrypoint for the package with its own set of features and requirements.

Copy link
Member

Choose a reason for hiding this comment

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

NIT: I think the consensus is that this should be removed? But not a blocker on merging this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing it means using a different tsconfig for building this target that includes the es2017.object lib. I haven't gotten an answer to if that's ok, but since no other package seems to do it I think it would need approval from someone like @alexeagle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spoke to Pete, he showed me where in compiler-cli he did the exact same thing, it's now using the extra lib and using commonjs modules.

@petebacondarwin
Copy link
Member

Oh and up to now all localize related commits have used the ivy scope.
Have you discussed adding this localize scope with anyone?

@filipesilva
Copy link
Contributor Author

@petebacondarwin I didn't know that the localize package should use ivy scopes. I haven't discussed it with anyone, just assumed the scope should be the package name. Will remove the change.

@filipesilva filipesilva changed the title Ng add localize feat(ivy): support ng-add in localize Sep 23, 2019
@filipesilva filipesilva changed the title feat(ivy): support ng-add in localize feat(ivy): support ng-add in localize package Sep 23, 2019
@mary-poppins
Copy link

You can preview 9364875 at https://pr32791-9364875.ngbuilds.io/.

Copy link
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

See above.

@filipesilva
Copy link
Contributor Author

@petebacondarwin added the README you requested as well.

@mary-poppins
Copy link

You can preview ed51d57 at https://pr32791-ed51d57.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 5680042 at https://pr32791-5680042.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 5be4ade at https://pr32791-5be4ade.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 61cd8a2 at https://pr32791-61cd8a2.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 4656c81 at https://pr32791-4656c81.ngbuilds.io/.

Copy link
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM

@ngbot ngbot bot added this to the needsTriage milestone Sep 25, 2019
@filipesilva filipesilva removed the request for review from clydin September 26, 2019 10:06
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

LGTM for dev-infra.


This schematic will be executed when a Angular CLI user runs `ng add @angular/localize`.

It will search their `.angular.json` file, and find polyfills and main files for server builders.
Copy link
Member

Choose a reason for hiding this comment

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

.angular.json --> angular.json

{
"$schema": "http://json-schema.org/schema",
"id": "SchematicsAngularBazelNgAdd",
"title": "Angular Bazel Ng Add Schema",
Copy link
Member

Choose a reason for hiding this comment

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

Why "Bazel"? 😕

Copy link
Member

Choose a reason for hiding this comment

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

😱

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:x

@gkalpak gkalpak added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Sep 26, 2019
@filipesilva filipesilva removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Sep 26, 2019
@mary-poppins
Copy link

You can preview a705927 at https://pr32791-a705927.ngbuilds.io/.

@filipesilva filipesilva added the action: merge The PR is ready for merge by the caretaker label Sep 27, 2019
@atscott atscott added the action: presubmit The PR is in need of a google3 presubmit label Sep 27, 2019
@atscott
Copy link
Contributor

atscott commented Sep 27, 2019

Presubmit
Ivy Presubmit

@atscott atscott closed this in e41cbfb Sep 27, 2019
cexbrayat added a commit to cexbrayat/angular that referenced this pull request Oct 7, 2019
The scheamtics added in angular#32791 is currently failing as the package.json does not reference it.

```
> ng add @angular/localize@9.0.0-next.9
+ @angular/localize@9.0.0-next.9
added 1 package from 1 contributor in 6.745s
Installed packages for tooling via npm.
The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.
```
cexbrayat added a commit to cexbrayat/angular that referenced this pull request Oct 7, 2019
The schematics added in angular#32791 is currently failing as the package.json does not reference it.

```
> ng add @angular/localize@9.0.0-next.9
+ @angular/localize@9.0.0-next.9
added 1 package from 1 contributor in 6.745s
Installed packages for tooling via npm.
The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.
```
alxhub pushed a commit that referenced this pull request Oct 7, 2019
The schematics added in #32791 is currently failing as the package.json does not reference it.

```
> ng add @angular/localize@9.0.0-next.9
+ @angular/localize@9.0.0-next.9
added 1 package from 1 contributor in 6.745s
Installed packages for tooling via npm.
The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.
```

PR Close #33025
ODAVING pushed a commit to ODAVING/angular that referenced this pull request Oct 18, 2019
The schematics added in angular#32791 is currently failing as the package.json does not reference it.

```
> ng add @angular/localize@9.0.0-next.9
+ @angular/localize@9.0.0-next.9
added 1 package from 1 contributor in 6.745s
Installed packages for tooling via npm.
The package that you are trying to add does not support schematics. You can try using a different version of the package or contact the package author to add ng-add support.
```

PR Close angular#33025
@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 Oct 28, 2019
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 action: presubmit The PR is in need of a google3 presubmit cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants