Deprecate replacing full context object of EmbeddedViewRef#51887
Deprecate replacing full context object of EmbeddedViewRef#51887devversion wants to merge 4 commits intoangular:mainfrom
EmbeddedViewRef#51887Conversation
2452fe9 to
afa3646
Compare
afa3646 to
6457aae
Compare
6457aae to
f19a60d
Compare
EmbeddedViewRef to be assignableEmbeddedViewRef to be assignable
EmbeddedViewRef to be assignableEmbeddedViewRef assignable
f19a60d to
7e9fff0
Compare
7e9fff0 to
cd9b2c6
Compare
cd9b2c6 to
56b990c
Compare
5e19a46 to
6505d5b
Compare
EmbeddedViewRef assignableEmbeddedViewRef
pkozlowski-opensource
left a comment
There was a problem hiding this comment.
LGTM. I think I was confused about the sequence of changes between the 4 commits. The end version looks good, but the 3rd commit was a bit surprising.
pkozlowski-opensource
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: public-api
Reviewed-for: size-tracking
Reviewed-for: fw-core
Reviewed-for: fw-common
Adds a benchmark for potential upcoming `NgTemplateOutlet` context logic updates.
We are including a file, for some reason, that is outside of the root dir. This breaks TypeScript/ or more specifically VSCode from picking up this tsconfig- breaking path mappings and hence auto completion.
… in `EmbeddedViewRef` This partially reverts commit a3e1719 and deprecates behavior added. The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we revert as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`), creates technical limitations for Angular's internals and the usage pattern is rarely used (and can be addressed via simple assignments, `Object.assign` or the use of a proxy if replacing the full context object is still desirable) DEPRECATED: Swapping out the context object for `EmbeddedViewRef` is no longer supported. Support for this was introduced with v12.0.0, but this pattern is rarely used. There is no replacement, but you can use simple assignments in most cases, or `Object.assign , or alternatively still replace the full object by using a `Proxy` (see `NgTemplateOutlet` as an example). Also adds a warning if the deprecated
…ext swapping The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we reverted with the previous commit as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`). This change impacted the template outlet code because we actively relied on swapping out the full context if the user changes it. Previousl, before we allowed to swap out the context (in v16), we mutated the initial view context if it didn't change structurally- and in other cases the view was re-created. We improved this performance aspect with the changes to allow for the context to be swapped out + actually also fixed a bug where the initial context object was mutated and the user could observe this change. This commit adjusts for context not being replacable- while still keeping the bugs fixed and preserving the performance wins of not having to destroy/re-create the view whenever the context changes. Benchmarks: https://hackmd.io/J0Ci_JzxQ0K1AA1omXhIQQ
6505d5b to
f0b3730
Compare
|
@pkozlowski-opensource fixed the commit confusion. Caretaker note: Please ignore the |
|
This PR was merged into the repository by commit 7426948. |
We are including a file, for some reason, that is outside of the root dir. This breaks TypeScript/ or more specifically VSCode from picking up this tsconfig- breaking path mappings and hence auto completion. PR Close #51887
… in `EmbeddedViewRef` (#51887) This partially reverts commit a3e1719 and deprecates behavior added. The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we revert as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`), creates technical limitations for Angular's internals and the usage pattern is rarely used (and can be addressed via simple assignments, `Object.assign` or the use of a proxy if replacing the full context object is still desirable) DEPRECATED: Swapping out the context object for `EmbeddedViewRef` is no longer supported. Support for this was introduced with v12.0.0, but this pattern is rarely used. There is no replacement, but you can use simple assignments in most cases, or `Object.assign , or alternatively still replace the full object by using a `Proxy` (see `NgTemplateOutlet` as an example). Also adds a warning if the deprecated PR Close #51887
…ext swapping (#51887) The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we reverted with the previous commit as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`). This change impacted the template outlet code because we actively relied on swapping out the full context if the user changes it. Previousl, before we allowed to swap out the context (in v16), we mutated the initial view context if it didn't change structurally- and in other cases the view was re-created. We improved this performance aspect with the changes to allow for the context to be swapped out + actually also fixed a bug where the initial context object was mutated and the user could observe this change. This commit adjusts for context not being replacable- while still keeping the bugs fixed and preserving the performance wins of not having to destroy/re-create the view whenever the context changes. Benchmarks: https://hackmd.io/J0Ci_JzxQ0K1AA1omXhIQQ PR Close #51887
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ular#51887) Adds a benchmark for potential upcoming `NgTemplateOutlet` context logic updates. PR Close angular#51887
We are including a file, for some reason, that is outside of the root dir. This breaks TypeScript/ or more specifically VSCode from picking up this tsconfig- breaking path mappings and hence auto completion. PR Close angular#51887
… in `EmbeddedViewRef` (angular#51887) This partially reverts commit a3e1719 and deprecates behavior added. The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we revert as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`), creates technical limitations for Angular's internals and the usage pattern is rarely used (and can be addressed via simple assignments, `Object.assign` or the use of a proxy if replacing the full context object is still desirable) DEPRECATED: Swapping out the context object for `EmbeddedViewRef` is no longer supported. Support for this was introduced with v12.0.0, but this pattern is rarely used. There is no replacement, but you can use simple assignments in most cases, or `Object.assign , or alternatively still replace the full object by using a `Proxy` (see `NgTemplateOutlet` as an example). Also adds a warning if the deprecated PR Close angular#51887
…ext swapping (angular#51887) The context of an embedded view ref at some point was switched from a getter to an actual assignable property. This is something we reverted with the previous commit as it introduces additional complexity for our generated code (in terms of closures capturing the `ctx`). This change impacted the template outlet code because we actively relied on swapping out the full context if the user changes it. Previousl, before we allowed to swap out the context (in v16), we mutated the initial view context if it didn't change structurally- and in other cases the view was re-created. We improved this performance aspect with the changes to allow for the context to be swapped out + actually also fixed a bug where the initial context object was mutated and the user could observe this change. This commit adjusts for context not being replacable- while still keeping the bugs fixed and preserving the performance wins of not having to destroy/re-create the view whenever the context changes. Benchmarks: https://hackmd.io/J0Ci_JzxQ0K1AA1omXhIQQ PR Close angular#51887
See individual commits