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

I18n localize sourcemapping patch #38747

Commits on Sep 8, 2020

  1. refactor(compiler): capture interpolation source-spans in expression …

    …parser
    
    The expression parser will split the expression up at the interpolation markers
    into expressions and static strings. This commit also captures the positions of
    these strings in the expression to be used in source-mapping later.
    petebacondarwin committed Sep 8, 2020
    Copy the full SHA
    b32f4fc View commit details
    Browse the repository at this point in the history
  2. refactor(compiler): track the closing source-span of TagPlaceholders

    The `TagPlaceholder` can contain children, in which case there are two source
    spans of interest: the opening tag and the closing tag. This commit now allows
    the closing tag source-span to be tracked, so that it can be used later in
    source-mapping.
    petebacondarwin committed Sep 8, 2020
    Copy the full SHA
    b5ae014 View commit details
    Browse the repository at this point in the history
  3. refactor(compiler): move the MessagePiece classes into output_ast.ts

    The `MessagePiece` and derived classes, `LiteralPiece` and `PlaceholderPiece`
    need to be referenced in the `LocalizedString` output AST class, so that we
    can render the source-spans of each piece.
    petebacondarwin committed Sep 8, 2020
    Copy the full SHA
    c90f765 View commit details
    Browse the repository at this point in the history
  4. fix(compiler-cli): compute source-mappings for localized strings

    Previously, localized strings had very limited or incorrect source-mapping
    information available.
    
    Now the i18n AST nodes and related output AST nodes include source-span
    information about message-parts and placeholders - including closing tag
    placeholders.
    
    This information is then used when generating the final localized string
    ASTs to ensure that the correct source-mapping is rendered.
    
    See angular#38588 (comment)
    petebacondarwin committed Sep 8, 2020
    Copy the full SHA
    0c0f144 View commit details
    Browse the repository at this point in the history