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

Apply static vnode optimization to elements with directives #3528

Closed
nolanlawson opened this issue May 22, 2023 · 3 comments · Fixed by #3550
Closed

Apply static vnode optimization to elements with directives #3528

nolanlawson opened this issue May 22, 2023 · 3 comments · Fixed by #3550
Labels

Comments

@nolanlawson
Copy link
Collaborator

Similar to #3518, I don't see any reason why lwc:ref elements shouldn't be statically optimizable. We'd just have to pass in the ref to the VStatic vnode and set it when rendering.

@nolanlawson nolanlawson changed the title Apply static vnode optimization to elements with lwc:ref Apply static vnode optimization to elements with directives May 23, 2023
@nolanlawson
Copy link
Collaborator Author

Update: we can probably do this for lwc:inner-html, lwc:external, and maybe some other directives as well.

@git2gus
Copy link

git2gus bot commented May 26, 2023

This issue has been linked to a new work item: W-13491697

@nolanlawson
Copy link
Collaborator Author

I looked into it (#3550) and decided to do it for lwc:ref but not the others (for now). My reasoning:

  • lwc:inner-html seems doable, but low-value – the value of lwc:inner-html will usually be dynamic rather than static anyway
  • lwc:external does not use the typical h (HTML) API in api.ts that you might expect, so it seems complex to apply static optimizations to it right now (and also low-value since there aren't a lot of these today)
  • lwc:dom is the most promising, but synthetic shadow is deprecated, and plus it ended up being tricky to get synthetic shadow scoping / portals to work properly. I have working code (30b8eef), but it adds a lot of complexity and just doesn't seem very worth it.

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

Successfully merging a pull request may close this issue.

1 participant