Commit graph

7 commits

Author SHA1 Message Date
Jan Martin
b461e06ecb fix(core): catch hydration marker with implicit body tag (#60429)
When the browser parses a valid html5 response like this:

```html
<!-- ... -->
<title>My page</title>
</head>
<!--nghm-->
<app-root></app-root>
<!-- ... -->
```

The resulting DOM will only start adding nodes to the body when it
runs into the first non-header tag. E.g.:

```yml
- head
  - title "My page"
- comment "nghm"
- body
  - app-root
```

This isn't a sign that comments are modified, so it seems worth to
handle it gracefully.

PR Close #60429
2025-03-19 15:51:36 +01:00
arturovt
783c5bb586 refactor(core): change node navigation step to plain const (#59469)
We change the `enum` to a plain `const` to eliminate extra bytes, as `enum` is not really required. We might not be able to switch to `const enum` due to single-file compilation restrictions.

PR Close #59469
2025-01-13 11:12:47 -05:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Joey Perrott
31fdf0fbea refactor: migrate core to prettier formatting (#55488)
Migrate formatting to prettier for core from clang-format

PR Close #55488
2024-04-29 09:49:19 -07:00
Andrew Kushnir
ced237693a refactor(core): adding hydration for content projection (#49454)
This commit adds serialization and hydration logic for content projection.

While hydration for regular elements relies on their location in the TNode tree, the content projection may move elements around, so in order to hydrate them correcty, the runtime needs some extra information. This commit adds a serialization logic that adds element locations (instructions on how to navigate to a particular element from another known location of other element) into the hydration state for the following cases:

- when a TNode is a first element in projection segment (other nodes are linked from that node)
- when a TNode's next sibling is different before and after projection (we serialize extra info about the template-based sibling)
- when a TNode's previous sibling was a content projection (i.e. `<ng-content>` slot), because we can not rely on the previous element in this case (projection happens at a later point)

PR Close #49454
2023-03-21 17:42:53 +01:00
Pawel Kozlowski
81b9e858a8 Revert "refactor(core): adding hydration for content projection (#49454)" (#49511)
This reverts commit 7885f35fd6.

PR Close #49511
2023-03-21 13:51:14 +01:00
Andrew Kushnir
7885f35fd6 refactor(core): adding hydration for content projection (#49454)
This commit adds serialization and hydration logic for content projection.

While hydration for regular elements relies on their location in the TNode tree, the content projection may move elements around, so in order to hydrate them correcty, the runtime needs some extra information. This commit adds a serialization logic that adds element locations (instructions on how to navigate to a particular element from another known location of other element) into the hydration state for the following cases:

- when a TNode is a first element in projection segment (other nodes are linked from that node)
- when a TNode's next sibling is different before and after projection (we serialize extra info about the template-based sibling)
- when a TNode's previous sibling was a content projection (i.e. `<ng-content>` slot), because we can not rely on the previous element in this case (projection happens at a later point)

PR Close #49454
2023-03-21 09:44:03 +01:00