-
Notifications
You must be signed in to change notification settings - Fork 382
Utilize new data-amp-bind-* alternative syntax for amp-bind attributes #1162
Copy link
Copy link
Closed
Labels
EnhancementNew feature or improvement of an existing oneNew feature or improvement of an existing oneSanitizers
Milestone
Description
There is a new XHTML-compatible amp-bind attribute syntax: ampproject/amphtml#11115 via ampproject/amphtml#15408
Instead of:
<span class="foo" [class]="foo ? 'foo' : 'bar'">We can now do:
<span class="foo" data-amp-bind-class="foo ? 'foo' : 'bar'">What this means is that we now have an official way of representing amp-bind attributes in PHP's DOM internals. We can now eliminate AMP_DOM_Utils::get_amp_bind_placeholder_prefix() and AMP_DOM_Utils::restore_amp_bind_attributes() entirely, and AMP_DOM_Utils::convert_amp_bind_attributes() can be modified to just convert the bracketed syntax into the data-amp-bind-* syntax. There would be no need to restore the bracketed syntax when re-serializing. The result will be improved performance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or improvement of an existing oneNew feature or improvement of an existing oneSanitizers