-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Conversation
You can preview 90debce at https://pr32791-90debce.ngbuilds.io/. |
You can preview 39abc30 at https://pr32791-39abc30.ngbuilds.io/. |
You can preview 8753f5d at https://pr32791-8753f5d.ngbuilds.io/. |
You can preview f4ac0cc at https://pr32791-f4ac0cc.ngbuilds.io/. |
There was a problem hiding this 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.
|
||
|
||
// Object.values() is the right way of doing this but it is only available with the ES2017 | ||
// TS lib and is not downleveled. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Oh and up to now all localize related commits have used the ivy scope. |
@petebacondarwin I didn't know that the |
You can preview 9364875 at https://pr32791-9364875.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
@petebacondarwin added the README you requested as well. |
You can preview ed51d57 at https://pr32791-ed51d57.ngbuilds.io/. |
You can preview 5680042 at https://pr32791-5680042.ngbuilds.io/. |
You can preview 5be4ade at https://pr32791-5be4ade.ngbuilds.io/. |
You can preview 61cd8a2 at https://pr32791-61cd8a2.ngbuilds.io/. |
You can preview 4656c81 at https://pr32791-4656c81.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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. |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "Bazel"? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:x
You can preview a705927 at https://pr32791-a705927.ngbuilds.io/. |
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. ```
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. ```
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
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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the new behavior?
The
@angular/localize
package can by added to an Angular CLI project viang add
.Does this PR introduce a breaking change?
Other information