Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No hardcoded template attributes #1979

Merged
merged 23 commits into from
Jan 31, 2023
Merged

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Jan 24, 2023

fix #1028

needed for #101

time to create/clone basic (template/element.html) template and to render it has been reduced by ~25% (related with #1976)

see template/element.html changes to understand how to migrate your templates

if you do not use custom templates, no action should be needed

in View class a few hacks are needed as {$attributes} tag cannot be put into all templates currently, I belive the hacks are ok otherwise a massive HtmlTemplate rewrite would be needed to support these cases


regex to find templates /wo attributes tag: (?<!\s|\S)^((?!attributes)(\s|\S))*$(?!\s|\S)

@mvorisek mvorisek added the MAJOR label Jan 24, 2023
@mvorisek mvorisek force-pushed the no_hardcoded_template_attributes branch 13 times, most recently from 4426736 to 16c02a2 Compare January 26, 2023 00:42
@mvorisek mvorisek force-pushed the no_hardcoded_template_attributes branch 4 times, most recently from 3f7b214 to 2ae3b92 Compare January 26, 2023 14:13
(,? |(?<=\())id="\{\$_id\}"(?=[^()<>]*(?<!\w)attributes(?!\w))
(,? |(?<=\())style="\{\$style\}"(?=[^()<>]*(?<!\w)attributes(?!\w))
(,? |(?<=\())class="\{_ui\}ui\{/\} +(\{\$class\}|\{class\}\{/\}) +(\{\$_class\}|\{_class\}\{/\})"(?=[^()<>]*(?<!\w)attributes(?!\w))
@mvorisek mvorisek force-pushed the no_hardcoded_template_attributes branch 2 times, most recently from e69cdda to da15da1 Compare January 26, 2023 17:45
@mvorisek mvorisek force-pushed the no_hardcoded_template_attributes branch 4 times, most recently from c346710 to 10be88b Compare January 28, 2023 11:29
@mvorisek mvorisek removed the BC-break label Jan 31, 2023
@mvorisek mvorisek merged commit a98a39c into develop Jan 31, 2023
@mvorisek mvorisek deleted the no_hardcoded_template_attributes branch January 31, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some templates are missing common properties like id
1 participant