Lab Lab: Project Loading refactor#52523
Merged
Merged
Conversation
sanchitmalhotra126
left a comment
Contributor
There was a problem hiding this comment.
Looks good! A few minor questions
sanchitmalhotra126
approved these changes
Jun 29, 2023
breville
approved these changes
Jun 29, 2023
8 tasks
This file contains hidden or 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
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.
To prep for share/remix, we needed to load some level data for standalone levels. Previously we did not load any level data for standalone levels, and just loaded projects based on the channel id passed through app options. We still want to load the project based on that channel id, but also want to get level properties for the standalone level, as the level configuration contains information about share and remix headers. There is still one case where we load a project and never care about level data, which is
/projectbeats.In this PR I updated the thunks for setting up a lab a bit. What was previously
setUpForLevelis nowsetUpWithLevel, and takes an optional channel id. We will load level properties as before, but then create our project manager either based on the channel id if it exists, or based on the level and script if it does not.What was previously
loadProjectis nowsetUpWithoutLevel(to make things clearer). Previously we set up the project manager outside of this method, to make the methods more unified I moved that logic into this thunk, and then loaded the project as before. I also added the logic to cleanup any existing project manager, so if we want to use this in a page that switches projects without reloading from the server we can.I also added a couple useful level properties to lab redux,
hideShareAndRemixandisProjectLevel, which will be used in the upcoming share and remix work.Links
Testing story
Tested locally that an
allthethingslevel, a standalone project, and/projectbeatsstill work.PR Checklist: