-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add RunContext
support for script outputs
#765
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened with the submodules?
Otherwise, I think this is a good idea. I'll think on the best way to pass project config to snapshots, though I imagine we'll end up passing arund a reference to a config object, so if you want to assume that's the appropriate course I wouldn't object.
Co-authored-by: Micah <[email protected]>
Thanks @Dekkonot! I'm not sure what happened with the submodules, as they keep pushing up and I don't want to force push after each commit (like I did with the first after I saw the submodules) I'll remove them at the end. Okay, I'll have a go passing around a reference. |
Co-authored-by: Micah <[email protected]>
Okay, this is ready for a review. Please do let me know where I should write tests for this change, as I'm not sure how far I should extend them to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want tests for RunContext! Specifically, tests that check it works at all, if it builds properly, and how it works with nested projects.
Anything else you can think of would be good too. It doesn't need to be too extensive since it's not touching a lot of the code, but we want to have some checks just to be sure it works as expected.
@Dekkonot, I went ahead and switched back from |
As a general rule, you should be using EDIT: This applies mostly to literal uses of it, mind you. There's cases where you might want to use |
Sounds good - thanks for that! I'll change back to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I mentioned before, tests for building and syncing are what we'll need for this, but otherwise it looks good.
@Corecii Just to ensure we aren't misinformed or out of touch, does the plan above seem sound? TL;DR is that long-term we would move towards preferring |
That sounds reasonable to me. I agree that we should only change the default behavior with a major version increase since it's a breaking change. |
Co-authored-by: Micah <[email protected]>
Okay there is a hiccup with merging. I don't have the authority to bypass that CI check so it can't be merged. |
Thank you so much guys! |
Is there support for gradual adoption of RunContext for individual scripts? Mixing Classes and RunContext together? Considering RunContext and Class have very different behavior, supporting both only makes sense. I think via a |
You can use nested |
Resolves rojo-rbx#667 This PR: - Introduces a new field in the project file: `scriptType` which has the default value of `Class` (in parity with previous versions), but can also be `RunContext`. - This is then passed to `InstanceContext` from the `Project` struct. - This then changes the RunContext in the lua `snapshot_middleware` --------- Co-authored-by: Micah <[email protected]>
Resolves #667
This PR:
scriptType
which has the default value ofClass
(in parity with previous versions), but can also beRunContext
.InstanceContext
from theProject
struct.snapshot_middleware