-
Notifications
You must be signed in to change notification settings - Fork 3
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
Parsing Speedup by Adding Source Files via tsconfig #357
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ca21166
to
9f752d2
Compare
tmeyer2115
reviewed
Aug 30, 2023
tmeyer2115
approved these changes
Aug 30, 2023
tmeyer2115
added a commit
that referenced
this pull request
Aug 31, 2023
## Changes - Studio's startup time is now considerably faster. This is due to an improvement in the logic for parsing Component and Template files. (#357) - The Studio Plugin is now a direct, explicit dependency of Studio. That means users only have to install `@yext/studio`. They don't need to worry about manually installing `@yext/studio-plugin` as well. (#355)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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