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(localize): do not expose NodeJS typings in $localize runtime code #38700

Commits on Sep 3, 2020

  1. fix(localize): do not expose NodeJS typings in $localize runtime code

    A recent change to `@angular/localize` brought in the `AbsoluteFsPath` type
    from the `@angular/compiler-cli`. But this brought along with it a reference
    to NodeJS typings - specifically the `FileSystem` interface refers to the
    `Buffer` type from NodeJS.
    
    This affects compilation of `@angular/localize` code that will be run in
    the browser - for example projects that reference `loadTranslations()`.
    The compilation breaks if the NodeJS typings are not included in the build.
    Clearly it is not desirable to have these typings included when the project
    is not targeting NodeJS.
    
    This commit replaces references to the NodeJS `Buffer` type with `Uint8Array`,
    which is available across all platforms and is actually the super-class of
    `Buffer`.
    
    Fixes angular#38692
    petebacondarwin committed Sep 3, 2020
    Copy the full SHA
    4bf1815 View commit details
    Browse the repository at this point in the history