-
Notifications
You must be signed in to change notification settings - Fork 15
Add Scripts helper classes #109
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
base: main
Are you sure you want to change the base?
Conversation
camillobruni
commented
Jul 31, 2025
- Add ShellScripts and BrowserScripts helper classes
- Use temp array for scripts in both cases
- Directly add promise error handler for browser scripts
- Move runCode to the corresponding scripts class
✅ Deploy Preview for webkit-jetstream-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
LGTM with nits.
throw new Error("addWithURL not supported"); | ||
} | ||
|
||
addUtils() { |
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.
nit: if we anyways do this always, can't this be put into the ctor and remove this method?
this.scripts = []; | ||
} | ||
|
||
run() { |
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.
Could we have a short comment what this is doing? IIUC, this is basically a builder pattern, and run
doesn't actually run any scripts, but finishes assembling in a way that it can be later run by the driver.
So maybe also rename to assembleScripts
and let the comment mention that this object is not supposed to be used afterwards.
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.
it does actually run the scripts. The moment we attach them to the DOM or call loadString we do evaluate the script.