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 FW-741: //packages/bazel/test/ngc-wrapped/... tests #27470

Closed
wants to merge 3 commits into from

Commits on Dec 5, 2018

  1. fix(ivy): generate empty ngfactory files if needed

    Previously the ngfactory shim generator in ngtsc would always write two
    imports in the factory file shims:
    
    1) an import to @angular/core
    2) an import to the base file
    
    If the base file has no exports, import #2 would be empty. This turns out
    to cause issues downstream.
    
    This commit changes the generated shim so if there are no exports in the
    base file, the generated shim is empty too.
    alxhub authored and IgorMinar committed Dec 5, 2018
    Configuration menu
    Copy the full SHA
    024516e View commit details
    Browse the repository at this point in the history
  2. fix(ivy): add missing directoryExists() method to shim CompilerHost

    The method `ts.CompilerHost.directoryExists` is optional, and was not
    previously handled by our ts.CompilerHost wrapper for factory and
    summary shims (GeneratedShimsHostWrapper).
    
    TypeScript checks for the existence of this method and silently ignores
    things like typeRoots if it's not found. This commit adds proper handling
    of directoryExists() to the shim.
    
    A test is also added which verifies typeRoots behavior works when shims
    are enabled.
    alxhub authored and IgorMinar committed Dec 5, 2018
    Configuration menu
    Copy the full SHA
    820ea09 View commit details
    Browse the repository at this point in the history
  3. test(ivy): enable //packages/bazel/test/ngc-wrapped/... tests for Ivy

    This commit allows //packages/bazel/test/ngc-wrapped/... tests to run
    under Ivy mode. To get them to pass, it addresses a problem with the
    way the tests are configured: both test targets have sloppy .d.ts
    dependencies configured, leading to many type errors being generated
    in TypeScript for the .d.ts files.
    
    Due to the way ngc directs TypeScript emit, it avoids type-checking
    .d.ts files and thus this issue does not surface. ngtsc does a whole-
    program emit which results in full .d.ts type-checking by default,
    catching this configuration issue.
    
    To fix this, skipLibCheck is added to the tsconfig.jsons for these
    tests, which tells TypeScript to skip type-checking of the .d.ts files,
    avoiding this problem in a similar way to ngc.
    alxhub authored and IgorMinar committed Dec 5, 2018
    Configuration menu
    Copy the full SHA
    99182d8 View commit details
    Browse the repository at this point in the history