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(ngcc): cope with packages following APF v14+ #45833

Closed
wants to merge 4 commits into from

Commits on May 5, 2022

  1. refactor(ngcc): remove unused dependencies

    Remove some unused dependencies from `ngcc` source code.
    gkalpak committed May 5, 2022
    Configuration menu
    Copy the full SHA
    592a1af View commit details
    Browse the repository at this point in the history
  2. refactor(ngcc): move loadPackageJson() and related types to utils.ts

    Move the `loadPackageJson()` helper (and associated generic types, such
    as `JsonObject`) from `packages/entry_point.ts` to `utils.ts` and also
    rename it to `loadJson()`. This way, they can be used in other places in
    future commits, without introducing cyclical dependencies.
    gkalpak committed May 5, 2022
    Configuration menu
    Copy the full SHA
    c2a3fa1 View commit details
    Browse the repository at this point in the history
  3. fix(ngcc): cope with packages following APF v14+

    In PR angular#45405, the Angular Package Format (APF) was updated so that
    secondary entry-points (such as `@angular/common/http`) do not have
    their own `package.json` file, as they used to. Instead, the paths to
    their various formats and types are exposed via the primary
    `package.json` file's `exports` property. As an example, see the v13
    [@angular/common/http/package.json][1] and compare it with the v14
    [@angular/common/package.json > exports][2].
    
    Previously, `ngcc` was not able to analyze such v14+ entry-points and
    would instead error as it considered such entry-points missing.
    
    This commit addresses the issue by detecting this situation and
    synthesizing a `package.json` file for the secondary entry-points based
    on the `exports` property of the primary `package.json` file. This data
    is only used by `ngcc` in order to determine that the entry-point does
    not need further processing, since it is already in Ivy format.
    
    [1]: https://unpkg.com/browse/@angular/common@13.3.5/http/package.json
    [2]: https://unpkg.com/browse/@angular/common@14.0.0-next.15/package.json
    gkalpak committed May 5, 2022
    Configuration menu
    Copy the full SHA
    1e4527e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3686a06 View commit details
    Browse the repository at this point in the history