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

[compiler] reuse tags #148

Open
lifeart opened this issue May 17, 2024 · 1 comment
Open

[compiler] reuse tags #148

lifeart opened this issue May 17, 2024 · 1 comment

Comments

@lifeart
Copy link
Owner

lifeart commented May 17, 2024

If template has case like this:

{{#if this.name}}
   {{this.name}}
   {{format this.name}}
{{/if}}

We create 3 tags for same property this.name.
We could avoid it and create one tag.

We could do it in compile-time with let.
Or we could replace this. with custom proxy and have caching on this level.
In addition, we could transform {{this.name}} to {{get this "name"}} and use something like cellFor

@lifeart
Copy link
Owner Author

lifeart commented May 18, 2024

we should not reuse tags if used inside control flow (if) - #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant