-
Notifications
You must be signed in to change notification settings - Fork 128
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
Run AppWatcher as a dev process #4828
base: main
Are you sure you want to change the base?
Conversation
We detected some changes at packages/*/src and there are no updates in the .changeset. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1927 tests passing in 876 suites. Report generated by 🧪jest coverage report action from 72841f6 |
@@ -57,8 +51,10 @@ export class ESBuildContextManager { | |||
resolveDir: extension.directory, | |||
loader: 'tsx', | |||
}, | |||
stderr: this.stderr ?? process.stderr, | |||
stdout: this.stdout ?? process.stdout, | |||
logLevel: 'silent', |
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's the reason/effect behind this change?
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.
Stdout and stderr are actually ignored by esbuild, it always prints to process.stdout which breaks our custom concurrent output.
To solve that, we configure esbuild to be silent, and the errors are printed with the right format by the app-event-watcher
(see the usage of formatMessageSync
inside a useConcurrentOutputContext
// eslint-disable-next-line no-catch-all/no-catch-all, @typescript-eslint/no-explicit-any | ||
} catch (error: any) { | ||
return {status: 'error', error: error.message, handle: ext.handle} as const | ||
// If there is an `errors` array, it's an esbuild error, format it and log it |
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.
Do we have something that covers this behaviour in tests? i.e. making sure we don't regress on how we want these errors to be handled
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 don't think so, will add them
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.
Done @shauns
WHY are these changes introduced?
We want to use the AppWatcher globally by all the other processes, this way any process can subscribe to app changes during dev.
WHAT is this pull request doing?
AppWatcherProcess
that starts the App WatcherDevSessionProcess
BuildResult
in each extension event -> To know if the extension was successfully built after the detected change.How to test your changes?
Run
app dev
with the app management API.Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist