Conversation
11b59da to
f5ca2a1
Compare
54a5488 to
d657f8f
Compare
There was a problem hiding this comment.
We're not too far off from having this be a number[]. The problem is that it doesn't allow us to handle re-aliased host directive inputs.
|
Passing TGP, aside from some unrelated broken targets. |
pkozlowski-opensource
left a comment
There was a problem hiding this comment.
Very reasonable moves!
Special kudos for having small, focused commits for each refactor - makes it so much easier to review 🎉
packages/core/test/bundling/animations-standalone/bundle.golden_symbols.json
Outdated
Show resolved
Hide resolved
…ition Currently the values in `DirectiveDef.inputs` are either strings or arrays, depending if there are flags. This makes it a bit hard to work with, because each time it's read, the consumer needs to account for both cases. These changes rework it so the values are always an arrays.
Removes the `inputTransform` from the directive definition since this information is already available on the `inputs`.
An earlier refactor made the `InputTransformsFeature` a no-op so these changes remove the code that was generating it.
The input flags are already available on the definition so we don't need to store them on `TNode.inputs`.
Reworks the `InitialInputs` data structure to only store a public name and initial value, resulting in less memory usage and making it easier to work with.
Currently we resolve the DOM node when writing inputs up-front, because it's necessary for the `ng-reflect-` attributes. Since the attributes are dev-mode-only, we can move the resolution into the function that writes them so we can avoid the resolution when it's not used.
Attempting to write to directive inputs before the directive is created can lead to subtle issues that won't necessarily trigger errors. These changes add an assertion to catch such issues earlier.
Updates the bundle goldens to account for the latest changes.
Simplifies the functions that serialize inputs/outputs for the `ComponentFactory` type.
d657f8f to
71689f8
Compare
Removes the `inputTransform` from the directive definition since this information is already available on the `inputs`. PR Close #59980
An earlier refactor made the `InputTransformsFeature` a no-op so these changes remove the code that was generating it. PR Close #59980
|
This PR was merged into the repository by commit f41437e. The changes were merged into the following branches: main, 19.1.x |
The input flags are already available on the definition so we don't need to store them on `TNode.inputs`. PR Close #59980
Reworks the `InitialInputs` data structure to only store a public name and initial value, resulting in less memory usage and making it easier to work with. PR Close #59980
Currently we resolve the DOM node when writing inputs up-front, because it's necessary for the `ng-reflect-` attributes. Since the attributes are dev-mode-only, we can move the resolution into the function that writes them so we can avoid the resolution when it's not used. PR Close #59980
Updates the bundle goldens to account for the latest changes. PR Close #59980
Simplifies the functions that serialize inputs/outputs for the `ComponentFactory` type. PR Close #59980
…ition (#59980) Currently the values in `DirectiveDef.inputs` are either strings or arrays, depending if there are flags. This makes it a bit hard to work with, because each time it's read, the consumer needs to account for both cases. These changes rework it so the values are always an arrays. PR Close #59980
Removes the `inputTransform` from the directive definition since this information is already available on the `inputs`. PR Close #59980
An earlier refactor made the `InputTransformsFeature` a no-op so these changes remove the code that was generating it. PR Close #59980
The input flags are already available on the definition so we don't need to store them on `TNode.inputs`. PR Close #59980
Reworks the `InitialInputs` data structure to only store a public name and initial value, resulting in less memory usage and making it easier to work with. PR Close #59980
Currently we resolve the DOM node when writing inputs up-front, because it's necessary for the `ng-reflect-` attributes. Since the attributes are dev-mode-only, we can move the resolution into the function that writes them so we can avoid the resolution when it's not used. PR Close #59980
Updates the bundle goldens to account for the latest changes. PR Close #59980
Simplifies the functions that serialize inputs/outputs for the `ComponentFactory` type. PR Close #59980
|
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. |
Includes some refactors around how we store input data internally. The result is that:
TNodeand the directive definition.DirectiveDef.inputshas a consistent type no matter how an input is configured which makes it easier to reason about.InputTransformsFeature.DirectiveDef.inputTransformsfield.TNode.inputs.TNode.initialInputsdata structure.ng-reflect-attributes.Detailed list of changes:
refactor(core): simplify how inputs are stored in the directive definition
Currently the values in
DirectiveDef.inputsare either strings or arrays, depending if there are flags. This makes it a bit hard to work with, because each time it's read, the consumer needs to account for both cases.These changes rework it so the values are always an arrays.
refactor(core): remove inputTransforms from definition
Removes the
inputTransformfrom the directive definition since this information is already available on theinputs.refactor(compiler): remove input transforms feature
An earlier refactor made the
InputTransformsFeaturea no-op so these changes remove the code that was generating it.refactor(core): remove flags from TNode.inputs
The input flags are already available on the definition so we don't need to store them on
TNode.inputs.refactor(core): simplify InitialInputs data structure
Reworks the
InitialInputsdata structure to only store a public name and initial value, resulting in less memory usage and making it easier to work with.refactor(core): refactor(core): avoid unnecessary lookup when writing inputs
Currently we resolve the DOM node when writing inputs up-front, because it's necessary for the
ng-reflect-attributes. Since the attributes are dev-mode-only, we can move the resolution into the function that writes them so we can avoid the resolution when it's not used.refactor(core): add assertion to avoid writes to directive factories
Attempting to write to directive inputs before the directive is created can lead to subtle issues that won't necessarily trigger errors. These changes add an assertion to catch such issues earlier.