This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Replies: 1 comment
-
We're currently building Vapor on core's repo, this repo isn't maintained now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My idea is to add a static analysis step to detect const bindings with no reactivity and inline their values during template compilation.
Example:
Current output:
Proposed output:
Since msg is static and non-reactive, it can be resolved at compile time:
Another example:
Current output:
Proposed output:
Rationale:
msg is declared as a const and does not depend on any reactive data.
Its value will never change during the component’s lifetime.
Therefore, the template expression msg + "World" is also constant.
This can be resolved statically, just like a preprocessor macro in C/C++.
Benefits:
Removes unnecessary runtime text node updates.
Reduces the amount of generated render code.
Improves performance for static template parts.
Beta Was this translation helpful? Give feedback.
All reactions