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

Props set in playground should be evaluated in the server for the SSR preview #17

Open
cardoso opened this issue Jun 7, 2024 · 0 comments

Comments

@cardoso
Copy link
Contributor

cardoso commented Jun 7, 2024

Currently setting the component props in playground will evaluate inside the playground's context (browser), lacking access to the server-side environment such as global variables and classes.

The playground README.md seems to imply it should be evaluated in the server-side.

The props don't have to be strings, and they don't even have to be serializable JavaScript objects. Any JavaScript expression that could be evaluated in an SSR enviroment should be supported.

Here's an easy to reproduce example using Date.now():

Set in code

Screenshot 2024-06-07 at 22 52 01

Set in playground

Screenshot 2024-06-07 at 22 52 26

I'm still getting familiar with the project, so maybe some of the above isn't in line with the intended purpose, but in that case it can be clarified in the docs or UI.

@cardoso cardoso changed the title Props set in playground should be evaluated in the component's context Display computed prop values in playground Jun 8, 2024
@cardoso cardoso changed the title Display computed prop values in playground Props set in playground config should be evaluated in the server for rendering the SSR preview Jun 8, 2024
@cardoso cardoso changed the title Props set in playground config should be evaluated in the server for rendering the SSR preview Props set in playground should be evaluated in the server for the SSR preview Jun 8, 2024
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

1 participant