feat(ivy): implement UMD for ngcc#25445
Conversation
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
You can preview 215d9d2 at https://pr25445-215d9d2.ngbuilds.io/. |
215d9d2 to
a681c28
Compare
|
You can preview a681c28 at https://pr25445-a681c28.ngbuilds.io/. |
a681c28 to
03b3a45
Compare
UmdReflectionHost for ngcc|
You can preview 03b3a45 at https://pr25445-03b3a45.ngbuilds.io/. |
24356f0 to
fb79996
Compare
|
You can preview fb79996 at https://pr25445-fb79996.ngbuilds.io/. |
fb79996 to
c96ca1f
Compare
|
You can preview c96ca1f at https://pr25445-c96ca1f.ngbuilds.io/. |
c96ca1f to
96787b8
Compare
|
You can preview 96787b8 at https://pr25445-96787b8.ngbuilds.io/. |
96787b8 to
ce1f13a
Compare
alxhub
left a comment
There was a problem hiding this comment.
👍
A couple more points about .has and using && and || as control flow.
It occurs to me that maybe I should write a TS style guide for the compiler, outlining the opinions I'm trying to enforce in the code, as well as the rationale for both of them.
7a0097b to
81c9680
Compare
|
Agh! Sorry @alxhub I should have been more careful and fixed all of those. |
81c9680 to
0929fb3
Compare
0929fb3 to
d679c83
Compare
|
@jasonaden - conflicts resolved and rebased on master. |
…rts` Previously we were just checking that the object was "any" object but now we check that it is the file object that we expected.
Previously we were using an anonymous type `{specifier: string; qualifier: string;}`
throughout the code base. This commit gives this type a name and ensures it
is only defined in one place.
The `getDeclaration()` function now searches down into the AST for matching nodes, which is needed for UMD testing.
In UMD formats, imports are always namespaced. This commit makes ngcc more tolerant of such structures.
This will be important for UMD support.
Previously these fake files were full TypeScript source files (`.ts`) but this is not necessary as we only need the typings not the implementation.
In some cases the `forwardRef` helper has been imported via a namespace, e.g. `core.forwardRef(...)`. This commit adds support for unwrapping such namespaced imports when ngtsc is statically evaluating code.
Previously the same `Renderer` was used to render typings (.d.ts) files. But the new `UmdRenderer` is not able to render typings files correctly. This commit splits out the typings rendering from the src rendering. To achieve this the previous renderers have been refactored from sub-classes of the abstract `Renderer` class to classes that implement the `RenderingFormatter` interface, which are then passed to the `Renderer` and `DtsRenderer` to modify its rendering behaviour. Along the way a few utility interfaces and classes have been moved around and renamed for clarity.
The dependency resolution that works out the order in which to process entry-points must also understand UMD formats.
Previously we were relying upon the `.get()` method to return `undefined` but it is clearer and safer to always check with `.has()` first.
d679c83 to
c52551a
Compare
|
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. |
Add support to ngcc for UMD formatted packages.
Sits on top of #29643