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

Default to Running Studio Without Strict Mode #426

Merged
merged 11 commits into from
Oct 31, 2023
Merged

Conversation

alextaing
Copy link
Contributor

@alextaing alextaing commented Oct 30, 2023

This PR adds a flag that will render Studio in React Strict Mode. Now, Studio runs without React Strict Mode by default, but can be specified to run in Strict Mode by adding strict as an argument to the empty -- flag (i.e. npx studio -- strict). This was also added to the dev command in the test site, but not the e2e-tests.

Since we are trying to access an env variable to determine a conditional render in Studio client-side, we cannot access process.env directly. Vite offers import.meta.env as a way for client-side modules to access env vars, but they must be prefixed with VITE_. This is why the env var is called VITE_STUDIO_STRICT.

J=SLAP-2966
TEST=manual

Copy link
Contributor

@nmanu1 nmanu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we want to look into this approach to achieve similar behavior?

@alextaing
Copy link
Contributor Author

Did we want to look into this approach to achieve similar behavior?

Talked with Tom, and I think that he wants to get Strict mode working for now, then look into this later. I think there's a lot to test with regards to that change, and I think we want to get some QA feedback addressed first. We'll keep the item around, though!

Copy link
Contributor

@nmanu1 nmanu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the reasoning behind not wanting strict mode in e2e-tests?

@alextaing alextaing merged commit 0edd505 into main Oct 31, 2023
15 checks passed
@alextaing alextaing deleted the dev/strict-mode branch October 31, 2023 15:51
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

Successfully merging this pull request may close these issues.

None yet

2 participants