Replies: 1 comment
-
While I love our current live examples experience I understand that there are some compromises if we want to provide a safe experience. I think turning the examples readonly is a big blow for the overall impression and will be an additional hurdle for people who would like to tinker with them. There are countless times that I wanted to check how some small change would affect one of the WebGPU Samples only to realize once again that it's not editable. Having to redirect users to an external website may be okey depending on how fast the project creation on StackBlitz is. Embedding StackBlitz sandbox would be the ideal solution that would solve most of the concerns raised, although I assume there will be some difficulties with the integration (life is never so easy with high level APIs). |
Beta Was this translation helpful? Give feedback.
-
We want our Live Examples page to offer the best possible experience of exploring the library. Live updates, integrated code editor, example controls and such bring a big value to the product website. However, we are still working on improving some major aspects of the experience.
Taking inspiration from other similar solutions, we aimed to use WebContainers, to enclose the example code evaluation in a separated sandbox, to make the site safer. While this approach is still something we want to potentially explore in the future, for now we find that using an integration with an existing code sandbox solution is the way to go.
Main challenges when implementing fully custom web containers sandbox:
The current proposal is therefore as follows:
The example can be in its own
example.ts
file (the only one that user should want to modify). Then in another file (index.ts
) we can import every exported example control object and construct the example control panel from it.Beta Was this translation helpful? Give feedback.
All reactions