Replies: 1 comment 15 replies
-
@gregod Good question. The main reason for Elder.js writing it to the HTML has been some users are using Elder.js at the edge which makes deploys easier. In On data heavy pages, I 100% agree that external files are a better answer. I just haven't had time to explore it. Open to a PR or continuing this discussion. |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment, the data required for hydration is written directly as a script tag to the (otherwise static) site. From a no-js first perspective, this prop data seems wasteful as we need to wait for lazily importing the component anyway. Was this done for performance reasons?
I'm proposing to write the prop data to a js module instead of the HTML and then import both data and the component in parallel in the hydration code triggered by the interaction observer. This should perform almost as well while minimizing the js required in the static HTML file.
Maybe an option would be to inline up until a specific size and switch to importing otherwise?
Beta Was this translation helpful? Give feedback.
All reactions