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

Ability to set certain properties / attributes as always static #343

Open
chiefcll opened this issue Aug 21, 2024 · 1 comment
Open

Ability to set certain properties / attributes as always static #343

chiefcll opened this issue Aug 21, 2024 · 1 comment

Comments

@chiefcll
Copy link

chiefcll commented Aug 21, 2024

Using the universal renderer - I have a property style for nodes which is never dynamic. Is there a way to list certain props / attributes as never dynamic to avoid the user needing to add /@once/ marker?

I see style might do something like this already:

} else if (
          config.effectWrapper &&
          (isDynamic(attribute.get("value").get("expression"), {
            checkMember: true
          }) ||
            ((key === "classList" || key === "style") &&
              !attribute.get("value").get("expression").evaluate().confident))
        ) {
@ryansolid
Copy link
Owner

We do a trick where we can evaluate expressions and hoist them out. But that only works within module scope and basically on constants... classList and Style are a bit special cased because their dynamicism is broken down to object properties, but I don't have a generic way to do that. In general I could see the potential of adding a list for saying static I suppose, but we don't have that concept in the DOM.

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

2 participants