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

Hide live preview button in storm #348

Merged
merged 37 commits into from
Aug 25, 2023

Conversation

alextaing
Copy link
Contributor

@alextaing alextaing commented Aug 23, 2023

This PR hides the Live preview button and stops pages dev from running when in CBD. This PR also resizes some of the icons in the action bar (info and viewport) since their height made the action bar stretch too tall.

Tests were updated by adding isWithinCBD to the virtual_yext-studio mock. Also isWithinCBD was moved from GitData into StudioData, and was also updated in tests.

See this test site.

Live preview button does not appear in CBD and pages dev does not spawn
image
image

Live preview button does appear locally and pages dev does spawn
image
image

J=SLAP-2891
TEST=manual

@tmeyer2115 tmeyer2115 added the wip label Aug 24, 2023
@alextaing alextaing removed the wip label Aug 24, 2023
@alextaing alextaing requested review from oshi97 and nmanu1 August 24, 2023 16:04
@alextaing alextaing requested a review from oshi97 August 25, 2023 13:26
Copy link
Contributor

@oshi97 oshi97 left a comment

Choose a reason for hiding this comment

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

lgtm!

@alextaing alextaing merged commit 18229e6 into main Aug 25, 2023
@alextaing alextaing deleted the dev/hide-live-preview-button-in-storm branch August 25, 2023 17:47
alextaing added a commit that referenced this pull request Aug 25, 2023
This PR hides the Live preview button and stops pages dev from running when in CBD.  This PR also resizes some of the icons in the action bar (info and viewport) since their height made the action bar stretch too tall.

Tests were updated by adding `isWithinCBD` to the `virtual_yext-studio` mock. Also `isWithinCBD` was moved from `GitData` into `StudioData`, and was also updated in tests.

See [this test site](https://www.yext.com/s/3350634/sitesgit/82218/b/hide-live-preview-button).

**Live preview button does not appear in CBD and pages dev does not spawn**
![image](https://github.com/yext/studio/assets/59857107/572b3daa-9eaa-4c6d-b184-7f87ccdde3bf)
![image](https://github.com/yext/studio/assets/59857107/24519a86-5328-4dbd-89b1-f1354e885f8c)

**Live preview button does appear locally and pages dev does spawn**
![image](https://github.com/yext/studio/assets/59857107/ae2ade1d-e2d5-492d-99ac-9c13f4151943)
<img width="958" alt="image" src="https://github.com/yext/studio/assets/59857107/8b494cc8-f489-4023-bb9f-5d2f204a001d">

J=SLAP-2891
TEST=manual
tmeyer2115 added a commit that referenced this pull request Aug 28, 2023
## Features
- An Info button was added next to the Live Preview button. When
clicked, this displays the version number of Studio. (#346)
- Number-type Props now have a Field Picker. (#344)

## Changes
- The Live Preview button is now hidden when Studio is run in Storm. The
PagesJS Dev Server is also not started. (#348)
- Studio now supports PagesJS `^1.0.0-rc.1`. (#341)

## Bug Fixes
- Immer is now correctly installed as a direct dependency of Studio.
(#349)
oshi97 added a commit that referenced this pull request Aug 30, 2023
This PR updates our parsing classes to avoid dynamically add source
files to the project during initial parsing.
Instead, we specify a path to the user's tsconfig, so that ts-morph can
add them all at once on startup.
Originally, I wanted to never dynamically add source files. However,
this is still necessary for when we add new files,
at least not without reworking at least a good portion of how we write
to file.

This speeds up initial parsing because every time a source file is added
to the project (for instance via `addSourceFileAtPath` like we were
doing), ts-morph will recreate the entire typescript compiler Project
instance, which is a slow operation.

I update the unit test workflow to split up the studio/studio-plugin
tests, and also turn off coverage collection to speed up tests. We can
turn it back on when we actually do something with it.
We can also drop down the playwright test timeout now. The performance
improvements here help, and also
when we [updated the pages dev startup to use the
api](#348) instead of a spawnSync.

J=SLAP-2909
TEST=manual

my local test-site has speed up to ~6 second start time, down from ~18
seconds

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants