angular/packages/localize
Kristiyan Kostadinov 8be2c48b7c feat(core): implement new block syntax (#51891)
Switches the syntax for blocks from `{#block}{/block}` to `@block {}` based on the feedback from the community.

Read more about the decision-making process in our blog: https://blog.angular.io/meet-angulars-new-control-flow-a02c6eee7843

The existing block types changed in the following ways:

**Conditional blocks:**
```html
<!-- Before -->
{#if cond}
  Main content
  {:else if otherCond}
    Else if content
  {:else}
    Else content
{/if}

<!-- After -->
@if (cond) {
  Main content
} @else if (otherCond) {
  Else if content
} @else {
  Else content
}
```

**Deferred blocks**
```html
<!-- Before -->
{#defer when isLoaded}
  Main content
  {:loading} Loading...
  {:placeholder} <icon>pending</icon>
  {:error} Failed to load
{/defer}

<!-- After -->
@defer (when isLoaded) {
  Main content
} @loading {
  Loading...
} @placeholder {
  <icon>pending</icon>
} @error {
  Failed to load
}
```

**Switch blocks:**
```html
<!-- Before -->
{#switch value}
  {:case 1}
    One
  {:case 2}
    Two
  {:default}
    Default
{/switch}

<!-- After -->
@switch (value) {
  @case (1) {
    One
  }

  @case (2) {
    Two
  }

  @default {
    Default
  }
}
```

**For loops**
```html
<!-- Before -->
{#for item of items; track item}
  {{item.name}}
  {:empty} No items
{/for}

<!-- After -->
@for (item of items; track item) {
  {{item.name}}
} @empty {
  No items
}
```

PR Close #51891
2023-09-26 09:10:04 -07:00
..
init refactor(localize): use globalThis for global (#50063) 2023-07-14 18:32:01 +00:00
schematics fix(localize): ng-add schematics for application builder (#51777) 2023-09-15 09:07:51 +02:00
src refactor(localize): ignore code duplication error with compiler package (#51500) 2023-08-29 17:55:34 +00:00
test refactor: update packages/localize to be strict ESM (#48521) 2022-12-19 19:50:43 +00:00
tools feat(core): implement new block syntax (#51891) 2023-09-26 09:10:04 -07:00
BUILD.bazel refactor(localize): run spell check on localize package (#50445) 2023-05-24 13:56:55 +00:00
index.ts refactor(localize): bundle message digest algorithm directly in npm package (#48799) 2023-01-24 18:31:25 +00:00
localize.ts fix(localize): add triple slash type reference on @angular/localize on `ng add (#48502) 2023-01-04 11:50:45 -08:00
package.json build: update babel dependencies (#50932) 2023-09-15 09:03:24 +02:00
PACKAGE.md docs(language-service): correction of the demonstration translation (#50359) 2023-05-19 14:20:29 +00:00
private.ts refactor(localize): use globalThis for global (#50063) 2023-07-14 18:32:01 +00:00